读程序从键盘输入 1902 , 则程序的输出结果是 :( ) int fun(int n) { int m=0,c; while(n!=0) { c=n%10; m=m*10+c; n=n/10; } return(m); } int main() { int m; scanf("%d",&m); printf("%d\n",fun(m)); return 0; }
举一反三
- 阅读下面程序,则执行后的结果为( ). main( ) { int m=4,n=2,k; k=fun(m,n); printf("%d\n",k); } fun(int m,int n) { return(m*m*m-n*n*n);}
- 以下程序中,运行结果是36的有()。 A: include <stdio.h> B: define M(y) y*y int main() { printf("%d\n",M(6+0)); return 0; } C: include <stdio.h> D: define M(y) (y)*(y) int main() { printf("%d\n",M(6+0)); return 0; } E: include <stdio.h> int M(int y) { return y*y; } int main() { printf("%d\n",M(6+0)); return 0; } F: include <stdio.h> int M(int y) { return (y)*(y); } int main() { printf("%d\n",M(6+0)); return 0; }
- 下列程序的输出结果是( ). #define N 3 #define M 3 void fun(int a[M][N]) { printf("%d\n",*(a[1]+2));} main( ) { int a[M][N]; int i,j; for(i=0;i 4
- 下列程序的输出结果是(). int fun3(int x) { static int a=3; a+=x; return(a); } int main(void) { int k=2,m=1,n; n=fun3(k);n=fun3(m); printf("%d\n",n); return 0; }
- 有以下程序 #include int m=12; int fun( int x,int y ) { static int m=3; m= x * y - m ; return (m); } main() { int a=7, b=5; m=fun( a, b )/m; printf("%d\n", fun( a, b )/m ); } 程序运行后的输出结果是