填空题
What is the output from the following program segment?int i, c1 = 0, c2 = 0 ;int a[] = { 6,7,3, 13, 11, 5, 1, 15, 9, 4 } ;for ( i = 0; i < 10; i++ ){if( i%2 == 0 )c1++ ;if ( a[i]%2 == 0 )c2++ ;}printf( "c1=%d c2=%d\n", c1, c2 ) ;(提示:仔细分析程序功能,if( i%2 == 0 )用来判断下标的是否为偶数。a[i]%2 == 0 用来判断数组里面保存的内容是否为偶数)
套餐购买该问题答案仅对会员开放,欢迎开通会员 ¥ 19.9
0.64/天
1个月(不限次)
¥ 19.9
1000次
(不限时)
¥ 29.9
0.32/天
3个月(不限次)
¥ 59.9
0.16/天
1年(不限次)
立即支付