【单选题】【消耗次数:1】
以下程序的输出结果是_______? f(int b[],int m,int n) { int i,s=0; for(i=m;in;i=i+2) s=s+b[i]; return s; } int main() { int x,a[]={1,2,3,4,5,6,7,8,9}; x=f(a,3,7); printf(%d\n,x); }
7
8
9
10
参考答案:
复制
纠错
相关题目
【单选题】 有以下程序,程序执行后的输出结果是( ) #include int fun(int x [ ],int n) { static int sum=0,i; for(i=0; i{ sum+=x[i]; } return sum; } void main( ) { int a[ ]={1,2,3,4,5}; int b[ ]={6,7,8,9},s=0; s=fun(a,5)+fun(b,4); printf(%d\n,s); }
①  45
②  50
③  60
④  66
【单选题】 有以下程序,执行后输出结果是() main( ) { int m[][3]={1,4,7,2,5,8,3,6,9}; int i,j,k=2; for(i=0;i { printf(%d ,m[k][i]); } }
①  4 5 6
②  2 5 8
③  3 6 9
④  7 8 9
【简答题】 以下程序输出的结果是[填空1]。#include stdio.hvoid main(){ int x, i;for(i=1; i i++){ x=i;if(++x%2==0)if(++x%3==0)if(++x%7==0)printf(%d\n,x);}printf(“\n”);}
【简答题】 以下程序输出的结果是[填空1]。#include stdio.hvoid main(){ int x, i;for(i=1; i i++){ x=i;if(++x%2==0)if(++x%3==0)if(++x%7==0)printf(%d\n,x);}printf(“\n”);}
【简答题】 以下程序输出的结果是[填空1]。#include stdio.hvoid main(){int x, i;for(i=1; i i++){ x=i;if(++x%2==0)if(++x%3==0)if(++x%7==0)printf(%d\n,x);}printf(“\n”);}
【简答题】 int a[10]={0,1,2,3,4,5,6,7,8,9};int *p;int i;p=a;printf(%d\n,*p++);printf(%d\n,*++p);程序输出结果为[填空1]和[填空2]。
【单选题】 以下程序的输出的结果是()。 int x=3; main( ) int i; for(i=1;i<x;i++)incre( );incre( ) staic int x=1; x*=x+1; printf( %d, x);
①  25
②  26
③  27
④  28
【单选题】 以下程序的运行结果是(  )。 #include stdio.hvoid main(){int i=1,s=3;do{s+=i++;if (s%7==0)continue;else++i;} while (sprintf(%d\n
①  7
②  8
③  9
④  10
【单选题】 以下程序段运行后s的值是()。 int a[3][3]={1, 2, 3, 4, 5, 1, 2, 3, 4} ; int i, j, s=1; for(i=0; i for(j=i+1; j s+=a[i][j];
①  6
②  120
③  7
④  240
【单选题】 #define X a+b main( ) { int a=3,b=4,s1; s1=2*X; printf(%d\n,s1); },以上程序的运行结果是( )?
①  8
②  14
③  10
④  6
随机题目
【单选题】 <img src=http://huaweicloudobs.ahjxjy.cn/7aa2b07f7c4bc0138ff541741eb11ad7.png/>
①  <img src=http://huaweicloudobs.ahjxjy.cn/bf1d76bdd5a91587fa6694d5f61282ba.png/>
②  <img src=http://huaweicloudobs.ahjxjy.cn/2aec8807fc1205040dda4cb5c2e27238.png/>
③  <img src=http://huaweicloudobs.ahjxjy.cn/fc3b9aec83cb8e815e3f0db3d3c0dd10.png/>
④  <img src=http://huaweicloudobs.ahjxjy.cn/430bec855f6f34eb0bd5355d82c58979.png/>
【判断题】 <img src=http://huaweicloudobs.ahjxjy.cn/066e2ed81cee51f8e5e1de4383b87373.png/>
①  正确
②  错误
【判断题】 <img src=http://huaweicloudobs.ahjxjy.cn/94801c8f3b96a8447cf48068c66f23f6.png/>
①  正确
②  错误
【判断题】 <img src=http://huaweicloudobs.ahjxjy.cn/ffc1728676a27d6ea7cd13c47631b03d.png/>
①  正确
②  错误
【简答题】 <img src="http://huaweicloudobs.ahjxjy.cn/8181e820bd8714bdadb09174763317c0.png"/>
【简答题】 <img src="http://huaweicloudobs.ahjxjy.cn/2129516520956ca7ea944a6389d7c2e9.png"/>
【简答题】 <img src="http://huaweicloudobs.ahjxjy.cn/40eeb4abaab9dce72598810edff0d77c.png"/>
【简答题】 <img src="http://huaweicloudobs.ahjxjy.cn/45f02fe8d30cdba922d7515122b95d74.png"/>
【简答题】 <img src="http://huaweicloudobs.ahjxjy.cn/4297fb065557db3afa88a2957e047572.png"/>
【简答题】 <img src="http://huaweicloudobs.ahjxjy.cn/4875a8cdfcf1c5c52dc17d8b45712431.png"/>