U E D R , A S I H C RSS

피보나치/김민경

~cpp 
//재귀호출- 피보나치
//20050983 김 민경 

#include <stdio.h>

void input();
void process(int,int,int);

int n;

void main()
{
	input();	
}

void input()
{	
	printf ("수입력 = ");
	scanf ("%d",&n);
	process(0,1,0);
}


void process(int check1, int check2, int temp)
{
	if (temp==n) printf ("%d\n",check1);
	process(check2,check1+check2,temp+1);
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:27
Processing time 0.0079 sec