main() { int a=5; while(!(a-->5)) { switch(a) { case 1:a++; case 4:a+=4; case 5:a+=5;break;main(){ int a=5;while(!(a-->5)){ switch(a){ case 1:a++;case 4:a+=4;case 5:a+=5;break;default:a-=5;}}printf("%d\n",a);}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 17:55:07
main(){inta=5;while(!(a-->5)){switch(a){case1:a++;case4:a+=4;case5:a+=5;break;main(){inta=5;while(!(

main() { int a=5; while(!(a-->5)) { switch(a) { case 1:a++; case 4:a+=4; case 5:a+=5;break;main(){ int a=5;while(!(a-->5)){ switch(a){ case 1:a++;case 4:a+=4;case 5:a+=5;break;default:a-=5;}}printf("%d\n",a);}
main() { int a=5; while(!(a-->5)) { switch(a) { case 1:a++; case 4:a+=4; case 5:a+=5;break;
main()
{ int a=5;
while(!(a-->5))
{ switch(a)
{ case 1:a++;
case 4:a+=4;
case 5:a+=5;break;
default:a-=5;
}
}
printf("%d\n",a);
}

main() { int a=5; while(!(a-->5)) { switch(a) { case 1:a++; case 4:a+=4; case 5:a+=5;break;main(){ int a=5;while(!(a-->5)){ switch(a){ case 1:a++;case 4:a+=4;case 5:a+=5;break;default:a-=5;}}printf("%d\n",a);}
a初始赋值为5
a--,此时a=4,!(4>5)为真,进入switch的case4
a+=4,此时a=8
因为case4没有break,所以进入下一句case5
a+=5,此时a=13
break,所以进入下一次while判断
a--,此时a=12,!(12>5)为假,离开循环
所以最后输出的结果是12

#include int a=3,b=5; max (int a,int b) {int c; c=a>b?a:b; return (c); } void main() {int main(){ int x=5; while(x #include int b=2; int fun(int *k) {b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8}, C++题目看不懂,结果是怎么算出来的,#includeusing std::cin;using std::cout;using std::endl;float f1(int);float f2(int);double twice(float (*)(int),int);int main(){int a=3;int b=5;cout main() { int a; for(a=1;a main() {int m[10],a;for(a=0,a int a=3; main(){int s=0;{int a=5;s+=a++;}s+=a++;printf(%d ,s);} main() {int a[6],i; for(i=1;i3))%5; printf(%2d,a[i]);} } #include int b=2; int fun(int*k) { b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8}#include int b=2; int fun(int*k) { b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8},i;for(i=2;i 37、有以下程序 int a=2; int f(int *a) {return (*a)++;} main( ) { int s=0; { int a=5; s+=f(&a); } s+答案为什么是C,37、有以下程序 int a=2; int f(int *a) {return (*a)++;} main( ) { int s=0; { int a=5; s+=f(&a); } s+=f(&a); printf(%d void fun(int a,int b) { int t; t=a;a=b;b=t; } main()void fun(int a,int b){ int t; t=a;a=b;b=t; } main() { int c[10]={1,2,3,4,5,6,7,8,9,0}.i; for(i=0;i 矩阵相加(C++)#include using namespace std; const int rows=3;const int cols=3;void matrixadd(int *,int *,int *,int,int);int main(){int a[rows][cols]={{1,3,5},{7,8,11},{13,15,17}};int b[rows][cols]={{9,8,7},{6,5,4},{3,2,1}};int c[rows][cols]={0 fun ( int *p ) { int a=10; p = &a; ++a; } main ( ) { int a=5; fun (&a); printf (%d ,a); }#include fun ( int *p ) { int a=10; p = &a; ++a; } main ( ) { int a=5; fun (&a); printf (%d ,a); } int main() { float a=1.0f; cout 我想知道到底错在哪?#includevoid a(int []);void main(){int buu[5];int i;for(i=0;i int a=2; int f(int a); {return (a)++;} main() {int s=0; {int a=5; s+=f(&&a);} s+=f(&&a); printf(%da=2;int f(int a);{return (a)++;}main(){int s=0;{int a=5;s+=f(&&a);}s+=f(&&a);printf(%d ,s);}执行的输出结果是()A 10 B 9 C 7 D 8 #define N 20 fun(int a[],int n,int m) {int i; for(i=m;i>n;i--)a[i+1]=a[i]; return m; } void main() #define N 20fun(int a[],int n,int m){int i;for(i=m;i>n;i--)a[i+1]=a[i];return m;}void main(){ int i,a[N]={1,2,3,4,5,6,7,8,9,10};fun(a,0,N/2);for(i=0;i #include void main( ) { int a=3,b=5; int *p,*q; void f1(int x,int y);void f2(int *x,int *y);p=&a; q=&b;f1(*p,*q) ;printf(a=%d ,b=%d ,a,b);f2(p,q);printf(a=%d ,b=%d ,a,b);}void f1(int x,int y) { int t;t=x; x=y; y=t;}void f2(int *x,int *y) { int