본문 바로가기
정보과학

recurse

by chaechaekim 2019. 8. 31.
#include<stdio.h>
void recurse2(int y);
void recurse1(int x);
int main(void) {
	recurse1(9);
	return 0;
}

void recurse1(int x) {
	if(x)
		recurse2(x-1);
	printf("%d", x);
}

void recurse2(int y) {
	printf("*");
	if(y)
		recurse(y-1);
}

/*

*****13579
--------------------------------
Process exited after 0.0163 seconds with return value 0
계속하려면 아무 키나 누르십시오 . . .

*/

'정보과학' 카테고리의 다른 글

재귀함수  (0) 2019.09.02
n까지의 합  (0) 2019.09.02
bmp 이미지 프로세싱  (0) 2019.08.31
recur  (0) 2019.08.30
reverse  (0) 2019.08.30

댓글