下⾯C++代码执⾏后 ,求出⼏天后星期⼏ 。如果星期⽇则输出“星期天”否则输出形如“星期1” 。横线上应填⼊ 的代码是
int N , nowDay , afterDays ; cout << " 今天星期几? " << endl ; cin >> nowDay ; cout << " 求几天后星期几? " << endl ; cin >> afterDays ; N = nowDay + afterDays ; if ( ) printf ( " 星期天 " ); else printf ( " 星期 %d" , N % 7 );下⾯C++代码执⾏后输出是
int N = 0 , i ; for ( i = 1 ; i < 10 ; i ++ ) N += 1 ; cout << ( N + i );下⾯C++代码执⾏后输出的是
int tnt = 0 ; for ( i = 0 ; i < 100 ; i ++ ) tnt += i % 10 ; cout << tnt ;下⾯C++代码执⾏后输出的是
int N = 0 , i ; int tnt = 0 ; for ( i = 5 ; i < 100 ; i += 5 ){ if ( i % 2 == 0 ) continue ; tnt += 1 ; if ( i >= 50 ) break ; } cout << tnt ;下⾯的程序⽤于判断输⼊的整数N是否为能被3整除的偶数 ,横线处应填写代码是
int N ; cin >> N ; if ( ) cout << " 能被 3 整除的偶数 " << endl ; else cout << " 其他情形 " << endl ; cout << endl ;下⾯C++代码执⾏后的输出是
int cnt ; cnt = 0 ; for ( int i = 1 ; i < 10 ; i ++ ) cnt += i ++ ; cout << cnt ; cout << endl ;int类型变量a的值是⼀个正⽅形的边长 ,如下图中的正⽅形的四条边长都为4 ,则下列哪个语句执⾏后能够 使得正⽅形的周长(四条边长的和)增加4?
+ + + + + + + + + + + + + + + +下⾯C++代码⽤于判断输⼊的整数是否为位增数,即从⾸位到个位逐渐增⼤ ,是则输出1 。如123是⼀个位增 数 。下⾯横线处应填⼊的是
int N; int n1 , n2 ; cin >> N; ______________; while ( N ){ n1 = N % 10 ; if ( n1 >= n2 ){ cout << 0 ; return 1 ; } n2 = n1 , N /= 10 ; } cout << 1 ; cout << endl ; return 0 ;下⾯C++代码执⾏后将输出10。
int N = 0 ; for ( int i = 0 ; i < 10 ; i ++ ){ continue ; N += 1 ; } cout << N ;下⾯C++代码执⾏后将输出100 。
int i ; for ( i = 0 ; i <= 100 ; i ++ ) continue ; cout << i ;下⾯C++代码被执⾏时 ,将执⾏三次输出(即标记⾏L2将被执⾏⼀次) 。
for ( int i = 0 ; i < 10 ; i += 3 ) cout << i ; //L226题 | 被引用0次