4 、下面的程序是求 1!+3!+5!+ …… +n! 的和。 #include main( ) { long int f,s; int i,j,n; ( 1 ) ; scanf(%d,&n); for(i=1;i<=n; ( 2 ) ) { f=1; for(j=1; j<=i;j++) ( 3 ) ; s=s+f; } printf(n=%d,s=%ld\n,n,s); }
相似题目
-
以下程序的输出结果是 main() {inta[4][4]={{1,3,5},{2,4,6},{3,5,7}}; printf(";";%d%d%d%d\n";";,a[0][3],a[1][2],a[2][1],a[3][0]; }
-
以下程序段的输出结果是() int a[4][4]={{1},{2,3},{4,5,6},{7,8,9,10}},s=0,i;for(i=0;i<4;i++) s+=a[i][i]+a[i][3-i]; printf("%d\n",s); 1+3+5+6+7+10
-
以下程序的输出结果是()。 main() { int a[4][4]={{1,3,5},{2,4,6},{3,5,7}}; printf("%d%d%d%d\n",a[0][3],a[1][2],a[2][1],a[3][0]); }
-
以下程序的输出结果是main(){inta[4][4]={{1,3,5},{2,4,6},{3,5,7}};printf(""%d%d%d%d\n"",a[0][3],a[1][2],a[2][1],a[3][0];}
-
有如下程序: #include int main() { int a[3][4]={1,2,3,4,5,6,7,8}; int (*p)[4]=a; printf(%d\n,*(p+1)[1]); return 0; } 则下列说法中正确的是 。
-
int a[10]={1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10} ;a=a+3;printf(%d\n,*a);程序的输出结果是
-
有下列程序:voidsum(inta[]){a[0]=a[-1]+a[1];}main(){inta[10]={1,2,3,4,5,6,7,8,9,10};sum(&a[2]);printf(\%d\\n\,a[2]);}程序运行后的输出结果是()
-
以下程序的运行结果是inta[10]={1,2,3,4,5,6,7,8,9,10};int*p=&a[3],*q=p+2;printf(\%d\\n\,*p+*q);
-
5.以下程序的输出结果是 。main(){ int w=4,x=3,y=2,z=1;printf(\%d\\n\,(w
-
根据下面的文字资料回答 39~43 题N-ISDN是在(1 )基础上建立起来的网络,能够提供的最高速率是(2 )。网络提供基本接口速率时,传输声音需要使用(3 ),一路话音占用的数据传输数率是(4 ),占用户实际可用带宽的比例是(5 )。第39题:文中(1 )处正确的答案是()。
-
6、要求下面的程序运行后,显示如下结果: 2 10 4 6 1 5 2 3 2 4 7 8 5 1 3 2 则程序段中的划线处应填入()。 int a[4][4]={ ________ }; int i,j; for(i=0;i<4;i++) { for(j=0;j<4;j++) printf("%4d",a[i][j]); printf("\n"); }
-
有以下程序 include <stdio.h> main() { int s[12]={1,2,3,4,4,3,2,1,1,1,2,3},c[5]={0},i; for(i=0;i<12;i++) c[s[i]++; for(i=l;i<5;i++) printf("%d",c[i]); printf("\n"); } 程序的运行结果是
-
执行下面的程序后,输出的结果是 struct abc {int a,b,c;} main() {struct abc s[2]={{1,2,3},{4,5,6}};int t; t=s[0].a+s[1].b;printf("%d\n",t); }()
-
计算的近似值的一个公式是π/4=1-(1/3)+(1/5)-(1/7)+…+(-1)n-1(1/2n -1)。 某人编写下面的程序用此
-
下列程序的功能是求算式:1+1/2!+1/3!+1/4!+……前10项的和(其中n!的含义是n的阶乘)。请在空白处填入
-
1、 下面的程序段执行后,a[2]的值为() int[] a=new int[] { 7, 4, 8, 3, 6 }; int n = 5; for(int i=0; i<n-1; i++) { for(int j="0;" j++) if(a[j]> a[j+1]) { int temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } }
-
当执行下面的程序时,如果输入ABC,则输出结罘是()。 include<stdio.h> include<string.h> main() { char ss[10]="1,2,3,4,5": gets(ss);strcat(ss,"6789");printf("%s\n",ss); }
-
有以下程序,程序运行后的输出结果应为()。include "stdio.h"main(){ int aa【4】【4】={{1,2,3,4},{5,6,7,8},{3,9,10,2},{4,2,9,6}};int i,s=0;for(i=0;i<4;i++) s+=aa【i】【1】;printf("%d\n",s);}
-
功能:下面的程序是求1!+3!+5!+……+n!的和。 include <stdio.h> int main() { long int f,s; int i,j,n; _________; scanf("%d",&n); for(i=1;i<=n; i+=2) { f=1; for(j=1; j<=i;j++) ________ ; s=s+f; } printf("n=%d,s=%ldn",n,s); return 0; }
-
有下列程序: include voidmain() { ints[12]={1,2,3,4,4,3,2,1,1,1,2,3),c[5]= {0},i; for(i=0;i<12;i++)c[s[i]]++; for(i=1;i<5;i++)printf("%d",c[i]); printf("\n") } 程序的运行结果是()。
-
有如下程序: include main() { int a[5]={1,2,3,4,5},b[5]={0,2,1,3,0),i,s=0; for(i=0;i<5;i++)s=s+aEb[i]; printf(“%d\n”,s); } 程序运行后的输出结果是()。
-
下面的程序段将输出▁▁▁▁▁。doublea[]={1,2,3,4,5};printf("%d\n",sizeof(a);
-
以下程序段的输出结果是()int a【4】【4】={{1},{2,3},{4,5,6},{7,8,9,10}},s=0,i;for(i=0;i<4;i++)s+=a【i】【i】+a【i】【3-i】;printf("%d/n",s);1+3+5+6+7+10
-
运行下面的程序,其输出是()。include <stdio.h>main(){ int a=0,i; for(i=0;i<4;i++) { switch(i) { case 0: case 1: a+=1; case 2: a+=2; break; default: a+=5; } } printf("%d\n",a);}
推荐题目
- 患者,女,30岁,未婚。带下量多,色黄质黏,泡沫状,有臭气。阴痒,烦躁易怒,舌红苔黄腻,脉弦滑。治疗应首选()
- 断、接电缆引线前应检查相序并做好标志。10kV空载电缆长度不宜大于()。当空载电缆电容电流大于0.1A时,应使用消弧开关进行操作。
- 防爆电气设备的防爆标志由()部分组成。
- 党的十八大报告中指出,我国到哪一年要实现全面建成小康社会?
- 我国最重要的珊瑚礁保护区和最为瑰丽的海底世界是在()
- 龙生蛭胶囊的适应症有哪些()
- 女孩,10岁,双下肢大小不等出血性皮疹2周,伴关节肿痛,尿蛋白++,红细胞30~40个/HP()
- 供给侧结构性改革的重点任务包括()等。
- 国际法的特征包括国际法通过国际法院和安理会得到强制执行。()
- 44、《云山墨戏图》的作者是北宋画家米芾的儿子___________。