以下程序输出结果为int compute(int n){if(n==1)return 1;return compute(n-1)+n*n;}int main(){printf("%d\n",compute(3));}
查看答案
填空题:以下程序的运行结果是#includeint main(){int a=3, b=4;a = a - b;{int b= 2;a = a - b;b = a + b;printf("%d %d ",a,b);}printf("%d %d",a,b);return 0;}
以下程序的输出结果是什么?#include int a = 5;int main(){void fun();int a = 0,i;for(i = 0; i< 3; i++)fun();printf("%d",a);return 0;}void fun(){printf("%d",a--);}
以下程序的运行结果是#includeint fun(){int x = 0;x+=2;return x;}int main(){int i = 1,s;while(i++<3)s = fun();printf("%d",s);return 0;}
填空题:以下程序的运行结果是#includevoid num( ){extern int x,y;int a = 4,b = 3;x = a * b;y = a / b;}int x,y;int main(){int a = 6,b = 3;x = a * b;y = a / b;num();printf("%d %d\n",x,y);return 0;}