データ構造とアルゴリズム|再帰の簡単なレビュー


再帰について

印刷枚数

#include <stdio.h>

void printOut(int n){
	if(n >= 10){
		printOut(n / 10);
	}
	printf("%d", n % 10);
}

int main(){
	int n, result;
	scanf("%d", &n);
	printOut(n);
	
	return 0;
}
120件の元の記事を公開 201 件を賞賛 230,000回の閲覧+

おすすめ

転載: blog.csdn.net/wugenqiang/article/details/105412338