填空题以下函数sstrcat的功能是实现字符串的连接,即将t所指字符串复制到s所指字符串的尾部。例如:,所指字符串为abed,t所指字符串为efgh,调用函数sstrcat后s所指字符串为 abcdefgh。请填空。 #inehde <stdio.h> #include <string.h> void sstuat(char * 9,char *t) int n; n = strlen (s); while(*(s+n) ={{U}} {{/U}})s++; t++;
填空题程序如下: main() int i=4; printf("%d",-++i); 该程序执行后的输出结果以及i的值分别是______ 、_______。
填空题用以下程序计算1到100的整数的累加和。请填空。
main( )
{int i,sum={{U}} 【13】 {{/U}};
i=1;
for({{U}} 【14】 {{/U}})
{sum + =j
i + +;
}
printf("sum=%d/n",{{U}} 【15】 {{/U}});
}
填空题下列程序的运行结果是{{U}} {{U}} {{/U}} {{/U}}。
#include<stdio.h>
main
{ int k=4,m=3,p;
p=func(k,m);
printf("%d",p);
p=func(k,m);
printf("%d/n",p);}
func(a,b)
int a,b;
{ static int m=0,i=2;
i+=m+1;
m=i+a+b;
return(m);}
填空题下列程序的运行结果是______。
#include<stdio.h>
main()
{ int a, b,c,n;
a=2;b=0;c=1;n=1;
while(n<=3)
{c=c*a;b=b+ c;++n;}
printf("b=%d", B) ;
}
填空题下列程序的运行结果是______。
#define POW(r)(r)*(r)
main()
{ int x=3,y=2,t;
t=POW(x+y);
printf("%d/n",t);
}
填空题以下程序运行后的输出结果是{{U}} 【8】 {{/U}} 。
main( )
{ int a=1,b=3,c=5;
if (c=a+b) printf("yes/n");
else printf("no/n");
}
填空题某二又树中度为2的结点有18个,则该二又树中有______个叶子结点。
填空题44. 在E-R图中,图形包括矩形框、菱形框、椭圆框。其中表示实体联系的是{{U}} {{/U}}框。
填空题函数fun的功能是计算xn。 double fun(double x,int n) int i; double y=1; for(i=1;i<=n;i++) y=y*x; return y; 主函数中已经正确定义变量m,a,b并赋值,要调用函数fun计算:m=a4+b4-(a+b)3。实现这一计算的函数调用语句为 【12】 。
填空题下面程序把从终端读入的文本(用@作为文本结束标志)输出到一个名为bi.dat的新文件中,请填空。 #include "stdio.h" FILE *fp; main() char ch; if((fp=fopen( 【16】 ))==NULL)exit(0); while((ch=getchar())!='@')fputc(ch,fp); fclose(fp);
填空题下列给定程序中,函数fun()的功能是:对N名学生的学习成绩,按从高到低的顺序找出前m(m≤10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。 试题程序: #include<stdio.h> #include<malloc.h> #include<string.h> # include<conio.h> #define N 10 typedef struct ss char num[10]; int order; STU; STU *fun(STU a[], iht m) STU b[N], *tt; int i,j,k; 【1】 ; for(i=0; i<N; i++) b[i]=a[i]; for (k=0;k<m;k++) for (i=j=0;i<N;i++) if ( 【2】 ) j=i; tt [k]=b[j]; b[j].order=0; return 【3】 ; outresult (STU a[],FILE *pr) int i; for(i=0;i<N; i++) fprintf(pf,"No=%s Mark=%d/n", a[i].num,a[i].order); fprintf(pf,"/n/n"); main() STU [N]="A01",80,"A02",79, "A03",66,"A04",82,"A05",87, "A06",93,"A07",78,"A08",60, "A09",85,"A10",73; STU *p_order; int i,m; clrscr(); printf("*** The Origial data ***/n"); outresult(a, stdout); printf("/nGive the numeber of the students who have better score:"); scanf("%d", while (m>10) printf("/nGive the number of the studets who have better score:"); scanf("%d", p_order=fun(a,m); printf("*** THE RESULT ***/n"); printf("*** The top students ***/n"); for(i=0; i<m; i++) printf (" %s %d/n", p_order[i].num,p_order[i].order); free(p_order);
填空题以下fun函数的功能是:累加数组元素中的值,n为数组中元素的个数,累加的和值放入x所指的存储单元中。请填空。 fun(int b[ ],int n,int * x) int k,r=0; for(k=0,k<n;k + +)r= 【7】 ; 【8】 =r;
填空题以下程序运行后的输出结果是 【15】 。 int f(int a[], int n) if(n>=1)return f(a, n-1)+a[n-1]; else return 0; main() int aa[5]=(1, 2, 3, 4, 5), s; s=f(aa, 5); printf("% d/n", s);
填空题以下程序运行后的输出结果是{{U}} 【16】 {{/U}}。
#include <stdio, h>
#include <stating, h>
void fun(char * s,int p,int k)
{ int i;
for(i=p;i<k-1;i++) s[i] =s[i+2];
}
main( )
{ char s [] = "abedefg";
fun(s,3 ,strlen(s) ); puts(s);
}
填空题运用位运算,能将字符型变量ch中的大写字母转换成小写字母的表达式是______。
填空题以下程序运行后的输出结果是 【17】 。 #include <stdio.h> main() int p=30; printf("%d/n",(p/3>0 ? p/10:p%3));
填空题若x和y都是double型变量,且x的初值为3.0,y的初值为2.0,则表达式pow(y,fabs(x))的值为{{U}} 【6】 {{/U}}。
填空题下面程序的功能是求整数m、n的最大公约数,请填空。
main()
{ int m,n,r;
scanf("%d,%d",&m,&n);
if({{U}} 【18】 {{/U}}){r=m;m=n;n=r;)
while({{U}} 【19】 {{/U}})
{ r=m%n;m=n;n=r; }
printf("%d",m);
}
填空题计算机软件分为系统软件和应用软件,操作系统属于{{U}} 【1】 {{/U}}。
