下面程序的运行结果是 。#includeint main(){ int i=0,x=0,y=0;do{++i;if(i%2!=0){x=x+i;i++;}y=y+i++;}while(i<=7);printf("x=%d,y=%d\n",x,y);return 0;}
查看答案
下面程序的运行结果是 。#includeint main(){ int a=1,b=3,i=1;do{ printf("%d,%d,",a,b);a=(b-a)*2+b;b=(a-b)*2+a;if(i++%2==0) printf("\n");}while(b<100);return 0;}
当运行以下程序时,从键盘输入“-1 0<回车>”,则以下程序的运行结果是 。#includeint main(){ int a,b,m=1,n=1;scanf("%d%d",&a,&b);do{if(a>0) {m=2*n;b++;}else {n=m+n;a+=2;b++;}}while(a==b);printf("m=%d n=%d\n",m,n);return 0;}
下面程序的运行结果是 。#includeint main(){int i,t,sum=0;for(t=i=1;i<=10;){sum+=t;++i;if(i%3==0) t=-i;else t=i;}printf("sum=%d",sum);return 0;}
下面程序的运行结果是 。#includeint main(){ int i,j=4;for(i=j;i<=2*j;i++)switch(i/j){case 0:case 1:printf("*");break;case 2:printf("#");}return 0;}