填空题若有以下定义: char a;int b; float c;double d; 则表达式a*b+d-c值的类型为 【7】 。
填空题下面程序的输出结果是 【9】 。 main( ) int i=3,j=2; char * a="DCBA"; printf("%c%c/n",a[i],a[j])
填空题下面程序有两个printf语句,如果第一个printf语句输出的是194,则第二个printf语句的输出结果是{{U}} 【13】 {{/U}}。
main()
{ int a[10]={1,2,3,4,5,6,7,8,9,0},*p;
p=a;
printf("%x/n",p);
printf("%/n",p+9);
}
填空题存储300个16×16点阵的汉字信息需要 【5】 字节。
填空题下面程序中函数creat用于建立一个带头结点的单向链表,新产生的结点总是插在链表的末尾,单向链表的头指针作为函数值返回。将程序补充完整。 #include<stdiao.h> struct list char data; struct list * next;; struct list * creat() struct list *h,*p,*q; char ch; h= 【18】 malloc(sizeof(struct list)); p=q=h;ch=getchar(); while(ch!='?') p= 【19】 malloc(sizeof(struct list)); p->data=ch;q->next=p;q=p;ch=getchar(); p->next='/0'; 【20】 ;
填空题fun函数的功能是:首先对a所指的N行N列的矩阵,找出各行中的最大的数,再求这N个最大值中的最小的那个数作为函数值返回。请填空。 #include<stdio.h> #define N 100 int fun(int(*a)[N]) int row,col,max,min; for(row=0;row<N;row++) for(max=a[row][0],col=1;col<N;col++) if(______)max=a[row][col]; if(row==0)min=max; else if(______)min=max; return min;
填空题某学生的记录由学号、8门课程成绩和平均分组成,学号和8门课程的成绩已在主函数中给出,请编写函数fun(),其功能是:求出该学生的平均分,并放入记录的ave成员中。
例如,学生的成绩是85.5、76、69.5、85、91、72、64.5、87.5,则他的平均分应为78.875。
注意:部分源程序给出如下。
请勿改动主函数main()和其他函数中的任何内容,仅在函数fun()的花括号中填入你编写的若干语句。
试题程序 #include
<stdio.h> #define N 8 typedef struct
{ char num[10]; double s[N];
double ave; } STREC; void fun(STREC
*a) { } void main()
{ STREC s={"GA005", 85.5,76,69.5,85,91,72,64.5,87.5};
int i; fun( printf("The % s's student
data:/n", s.num); for(i=0; i<N; i++) printf("%
4.1f/n", s.s[i]); printf("/nave=% 7.3f/n", s.ave);
}
填空题已有文本文件test.txt,其中的内容为:Hello,everyone!。以下程序中,文件test.txt已正确为“读”而打开,由此文件指针fr指向文件,则程序的输出结果是【 】。
#include <stdio.h>
main( )
{ FILE *fr; char str[40];
......
fgets(str,5,fr);
printf("%s/n",str);
fclose(fr);
}
填空题以下程序运行后输出结果是U 【8】 /U。
#include
main()
{ int i, j;
for(i=6;i>3;i--) j=i;
printf("%d%d\n",i,j);
}
填空题软件的 【4】 设计又称为总体结构设计,其主要任务是建立软件系统的总体结构。
填空题以下程序的运行结果是{{U}} 【19】 {{/U}}。
#include<string.h>
typeaef struct student{
char name[10];
long sno;
float score;
{STU;
main()
{ STUa={"zhangsan",2001,95},b={"Shangxian",2002,90},c={"Anhua",2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0)d=b;
if(strcmp(C.name,d. name)>0)d=C;
printf("%1d%s/n",d.sno,p->name);
}
填空题请写出以下程序的输出结果______。
#include<stdio.h>
main()
{int a=100;
if(a>100) printf ("%d/n", a>100);
else printf("%d/n", a<=100);
}
填空题以下程序运行后的输出结果是 {{U}} 【18】 {{/U}}
fun(int x)
{ if(x/2>0) fun(x/2);
printf("%d ",x);
}
main( )
{ fun(6); }
填空题在使用putchar和getchar函数处理字符时,必须在程序的开头出现包含头文件的命令行是______。
填空题执行下面程序段后,k的值是 【8】 。 r=1;n=203;k=1 dok*=n%10*r;n/=10;r++;while(n);
填空题请补充函数proc(),该函数的功能是:计算下面公式的值(k<50):例如,当k=6时,m=6515.100198。注意:部分源程序给出如下。请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。试题程序:#include<stdlib.h>#include<conio.h>#include<stdio.h>doubleproc(intn){doublem=________;doublef=0.0;doublep=0.0;inti=0;intk;for(k=1;________;k++){f=2*k-1;p=2*k+1;for(i=1;i<2*k+1;i++)f*=2*k-1;for(i=1;i<2*k-1;i++)p*=2*k+1;________;}returnm;}voidmain(){intk=0;doublem;system("CLS");printf("/nPleaseinputk(k<50):");scanf("%d",m=proc(k);printf("/nS=%1f",m);}
填空题有一个学生选课的关系,其中学生的关系模式为:学生(学号,姓名,班级,年龄),课程的关系模式为:课程(课号,课程名,学时),其中两个关系模式的键分别是学号和课号,则关系模式选课可定义为:选课(学号,______,成绩)。
填空题51. 下面程序执行后输出的结果是{{U}} {{/U}}。int m=13;int fun(int x, int y) int m=3; return(x*y-m);main() int a=7,b=5; printf("%d//n",fun(a,B) /m);
填空题请补充函数fun(),该函数的功能是把数组bb中的数按从小到大的排列(数组的值及元素个数从土函数中输入)。
例如,输入2 3 5 4 1,结果为1 2 3 4 5。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun()吧的横线上填入所编写的若干表达式或语句。
试题程序:
# include<stdio. h>
# define N 100
void fun(int bb[], int n)
{
int i,j,t;
for (i=0;{{U}} 【1】 {{/U}};i++)
for(j=0;{{U}} 【2】 {{/U}};j++)
if(bb[j]>bb[j+1] )
{
t=bb[j];
bb [j]=bb [j+1];
bb[j+1]=t;
}
}
main()
{
int i=0, n=0;
int bb[N];
clrscr ();
printf("/nInput n: /n");
scanf ("%d",
printf ("/nInput data: /n");
while (i<n)
{
printf ("bb [%d] =", i);
scanf ("%d",
i++;
}
fun (bb, n);
printf("/n*** the result ***/n");
for (i=0; i<n; i++ )
printf ( "%4d'', bb [i]);
}
填空题给定程序中函数fun的功能是:将s所指字符串中的字母转换为按字母序列的后续字母(但Z转换为A,z转换为a),其它字符不变。
请改正函数fun中指定部位的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
给定源程序:
#include<stdio.h>
#include<ctype.h>
void fun(char*s)
{
/**********found**********/
while(*s!="@")
{if(*s>="A"
else if(*s=="z")*s="a";
else *s+=1;
}
/**********found**********/
(*s)++;
}
}
main()
{char s[80];
printf("/n Enter a string with length<80.:/n/n");gets(s);
printf("/n The string:/n/n");puts(s);
fun(s);
printf("/n/n The Cords:/n/n");puts(s);
}
