题目内容

写出下列程序的执行结果是:__________________。 #includeusing namespace std; void main() { int i, j, x = 0; for( i=0; i<=3; i++ ) { x++; for( j=0; j<=3; j++ ) { if( j % 2 ) continue; x++; } x++; } cout << "x=" << x << endl; }

查看答案
更多问题

//写出下列程序的执行结果是:__________________。#includeusing namespace std;void main(){ int i, s = 0; for( i=0; i<5; i++ ) switch( i ) { case 0: s += i; break; case 1: s += i; break; case 2: s += i; break; default: s += 2; } cout<<"s="<

写出下列程序的执行结果是:__________________。#includeusing namespace std;void main(){ int i,j; for( i=1, j=5; i

写出下列程序的执行结果是:__________________。 #includeusing namespace std; void main() { int i = 1 , j = 5; do { i++; j--; if ( i>3 ) break; } while ( j>0 ); cout << "i=" << i <<","<< "j=" << j << endl; }

写出下列程序的执行结果是:__________________。 #includeusing namespace std; void main() { int i = 1; while( i<=10 ) if( ++i % 3 != 1 ) continue; else { cout << i; if(i!=10) cout<<","; } }

答案查题题库