填空题表达式pow(2.8,sqrt(float(x)))值的数据类型为______型。
填空题一个项目具有一个项目主管,一个项目主管可管理多个项目,则实体“项目主管”与实体“项目”的联系属于{{U}} 【3】 {{/U}}的联系。
填空题若有定义:double W[10],则W数组元素下标的上限为 【11】 ,下限为 【12】 。
填空题设有下列程序:#include<stdio.h>#include<string.h>main() int i; char s[10],t[10]; gets(t); for(i=0;i<2;i++) gets(s); if(strcmp(t,s)<0)strcpy(t,s); printf("%s/n",t); 程序运行后,从键盘上输入(<CR>代表回车符):DEF<CR>BADEF<CR>QTHRG<CR>,则程序的输出结果是______。
填空题有以下程序: #include<stdio.h> main() int f,f1,f2,i; f1=0;f2=1 printf("%d%d",f1,f2); for(i=3;i<=5;i++) f=f1+f2;printf("%d",f); f1=f9;f2=f; printf("/n"); 程序运行后的输出结果是______。
填空题下列程序执行后输出的结果是{{U}} 【9】 {{/U}}。
f(int a)
{ static c=0;
c=a+c++;
return(c);
}
main()
{ int a=2,i,k;
for(i=0;i<2;i++)
k=f(a++);
prinf("%d/n",k);
}
填空题下述函数用于统计一行字符中的单词个数,单词之间用空格分隔。 word num (str) char str[]; int i,num=0,word=0; for(i=0;str[i]!= 【15】 ;i++) if( 【16】 ==)word=0; else if(word==0) word=1; 【17】 ; return(num);
填空题以下程序运行后的输出结果是______。 main() char c;int n=100; loat f=10;double x; x=f*=n/=(c=50); printf("%d%f/n",n,x);
填空题请补充函数fun(),该函数的功能是判断一个数是否为回文数。当字符串是回文时,函数返回字符申:yes!,否则函数返回字符串:no!,并在主函数中输出。所谓回文即正向与反向的拼写都一样,例如:abcba。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。 试题程序: #include<string.h> #include<stdio.h> char *fun(char*str) char *p1,*p2; int i, t=0; p1=str;p2=str+strlen(str)-1; for (i=0; 【1】 ;i++) if( 【2】 ) t=1; break; if ( 【3】 ) return("yes!"); else return("no!"); main() char str[50]; printf("Input;"); scanf("%s",str); printf("%s/n",fun(str));
填空题下列程序的运行结果是______。
main()
{ int x=1,y=2,z=3;
printf("%d,",x<y?y:x);
printf("%d,",z<y?x++:y++);
printf("%d,%d",x,y);
}
填空题设有下列程序:
#include<stdio.h>
#include<string.h>
main()
{ int i;
char s[10],t[10];
gets(t);
for(i=0;i<2;i++)
{ gets(s);
if(strcmp(t,s)<0)strcpy(t,s);
}
printf("%s/n",t);
}
程序运行后,从键盘上输入(<CR>代表回车符):DEF<CR>BADEP<CR>QTHRG<CR>,则程序的输出结果是______。
填空题请补充main函数,该函数的功能是:从键盘输入3个整数,然后找出最大的数并输出。 例如,输入:12,45,43,最大值为45。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: #include<stdio.h> #include<conio.h> main() int a, b, c, max; clrscr(); printf("/nlnput three numbers:/n"); scanf("%d,%d,%d", printf("The three numbers are:%d, %d,%d/n",a,b,c); if(a>b) 【1】 ; else 【2】 ; if(max<c) 【3】 ; printf("max=%d/n",max);
填空题给定程序中,函数fun的功能是判断形参S所指字符串是否是“回文”(Palindrome),若是,函数返回值为1;不是,函数返回值为0。“回文”是正读和反读都一样的字符串(不区分大小写字母)。
例如,LEVEL和Level是“回文”,而LEVLEV不是“回文”。
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
给定源程序如下。
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int fun(char *s)
{ char *lp,*rp;
/*********found*******/
lp=______;
rp=s+strlen(s)-1;
while((toupper(*lp)==toupper(*rp))rp______;}
/********found******/
if(lp<rp)______;
else return 1;
}
main()
{ char s[81];
printf("Enter a string:");scanf("%s",s);
if(fun(s)) printf("/n"%s"is a Palindrome./n/n",s);
else printf("in"%s/:isn"t a Palindrome./n/n",s);
}
填空题请补充main函数,该函数的功能是:打印出满足个位的数字、十位上的数字和百位上的数字都相等的所有二位数。 本题的结果为:111 222 333 444 555 666 777 888 999。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: #include <stdio.h> main () int g, s, b; clrscr ); for(g=1; g<10; g++) for (s=1; s<10; s++) for(b=l; b<10; b++) if( 【1】 ) printf("%5d", 【2】 );
填空题已知字母A的ASCⅡ码为65。以下程序运行后的输出结果是______。 main() char a,b; a='A'+'5'-'3';b=a+'6'-'2'; printf("%d%c/n",a,b);
填空题若a是int型变量,且a的初值为4,则计算a+=a-=a*a表达式后a的值为______。
填空题以下程序的功能是从名为“filea. dat”的文本文件中逐个读入字符并显示在屏幕上,请填空。 #include<stdio.h> main() FILE *fp; char ch; fp=fopen(______); ch=fgetc(fp); while(______(fp))putchar(ch); ch=fgetc(fp); putchar('/n'); fclose(fp);
填空题下列程序把三个NODETYPE型的变量链接成一个简单的链表,并在while循环中输出链表结点数据域中的数据,请填空。 #include<stdio.h> struct node int data;struct node*next;; typede f struct node NODETYPE; main() NODETYPE a,b,c*h,*p;a.data=10;b.data=20;c.data=30;h=&a;a.next=&b;b.next=&c;c.next='/0'; p=h; while(p)printf("%d,",p->data);______; printf("/n"):
填空题若有如下定义: int[]=11,24,56,19,29,39),*t=s; 则不移动指针t,且通过指针t引用数组中值为29的元素的表达式是 【7】 。
填空题下面程序的输出结果为______。
#include<stdio.h>
int func(int m, int n)
{
return(m*n);
}
int main()
{
int a=3, b=11, c=8, d;
d=func(func(a, b), c);
printf("%d/n", d);
getchar();
return 0;
}
