下面程序的运行结果是______。#includevoid main( ){ int a=1, b=10;do{ b-=a; a++;} while(b--<0);printf("%d, %d\n", a, b); }
查看答案
下面程序运行结果是______。#includevoid main( ){ int a, b; a=-1; b=0;do{ ++a; ++a; b+=a;} while(a<9);printf("%d\n", b); }
下面程序的运行结果是______。#includevoid main( ){ int i, j=4;for(i=0; i<4; i++)switch(i/j){ case 0: case 1: printf("*"); break; case 2: printf("#"); } }
编程计算1+3+5+……+101的值,请在横线上填写适当的语句。#include void main( ){int i, sum=0;for (i=1;______;______)sum=sum + i;printf("sum=%d\n", sum); }
下面程序的输出结果是______。int main( ){ int i, k=0, a=0, b=0;for(i=1;i<=4;i++){ k++;if (k%2==0){a=a+k; continue;} b=b+k; a=a+k; }printf("k=%d,a=%d,b=%d\n", k, a, b); }