题目内容

下面程序执行后的输出结果是______。#include int main(){int k = 0, m = 0, i, j;for ( i = 0; i < 2; i++ ){for ( j = 0; j < 3; j++ )k++;k -= j;}m = i + j;printf( "k=%d,m=%d", k, m );return(0);}

查看答案
更多问题

下面程序执行后的输出结果是______。#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); }

答案查题题库