题目内容

下面程序执行后的输出结果是______。#include int main(){int x = 1, y = 0, a = 0, b = 0;switch ( x ){case 1: switch ( y ){case 0: a++; break;case 1: b++; break;}case 2: a++; b++; break;case 3: a++; b++;}printf( "a=%d,b=%d", a, b );return(0);}

查看答案
更多问题

下面程序段运行时从键盘上输入:2473↙,其输出结果是______。#include int main(){int c;while ( (c = getchar() ) != '\n' )switch ( c - '2' ){case 0:case 1: putchar( c + 4 );case 2: putchar( c + 4 ); break;case 3: putchar( c + 3 );default: putchar( c + 2 ); break;}printf( "\n" );return(0);}

下面程序的运行结果是______。#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("#"); } }

答案查题题库