//写出下列程序的执行结果是:__________________。#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<<","; } }
写出下列程序的执行结果是:__________________。 #includeusing namespace std; void main() { int a,b,c,d,x; a = c = 0; b = 1; d = 50; if( a ) d = d-10; else if( !b ) if( !c ) x = 15; else x = 25; cout << d << endl; }