我有这个程序,我试图输出n的值,但我没有得到任何显示。程序符合要求,但没有输出。
#include <stdio.h>
int rec(int x, int y)
{
static int count = 0;
if(x==0)
return count;
count++;
if(x > y)
rec(x - y, y);
else
rec(x,y-x);
return count;
}
main(){
int i=0, j=2, n;
n = rec(i,j);
printf("%d", n);
}需要N的值作为输出,程序不显示任何内容。
发布于 2014-04-14 08:52:18
你确定它不会吗?您没有输出换行符,因此它会在下一个命令行提示符上显示出来,所以很容易遗漏。
https://stackoverflow.com/questions/23050303
复制相似问题