填空题执行下面程序段时输出suet,请填空。
main()
{ static char a[]="student";
char *p;
for(p=a;p<{{U}} 【8】 {{/U}};p+=2)
putchar(*p);
}
填空题线性表的存储结构主要分为顺序存储结构和链式存储结构。队列是一种特殊的线性表,循环队列是队列的 (2) 存储结构。
填空题下面程序的功能:输出100以内能被3整除且个位数为6的所有整数,请补充完整。
main()
{ int i,j;
for(i=0;{{U}} 【12】 {{/U}};i++)
{ j=i*10+6;
if({{U}} 【13】 {{/U}})continue;
printf("%d",j);
}
}
填空题下列程序的输出结果是 【13】 。 main() int a[]=2,4,6,*ptr= for(y=0;y<3;y++) z=(*(ptr+y)<x)?*(ptr+y):x; printf("%d/n",z);
填空题以下程序的运行结果是【 】
#include <string.h>
typedef struct student{
char name[10];
long sno;
float score; }STU;
main( )
{ STU a={“zhangsan”,2001,95},b={“Shangxian”,2002,90},
c={“Anhua”,2003,95},d,*p=
d=a;
if(strcmp(a.name,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf(“%ld%s/n”,d.sno,p->name); }
填空题从Windows环境进入MS-DOS方式后,返回Windows环境的DOS命令为{{U}} 【4】 {{/U}}。
填空题执行以下程序后,输出''#''号的个数是【 】。
#include <stdio.h>
main( )
{ int i,j;
for(i=1; i<5; i++)
for(j=2; j<=i; j++) putchar(''#'');
}
填空题用下面语句调用库函数malloc,使单精度型指针p指向具有40个字节的动态存储空间,请填空。 p=(float*) 【9】 ;
填空题请补充main函数,该函数的功能是:从键盘输入两上字符串并分别保存在字符数组str1和str2中,用字符串str2替换字符串str1前面的所有字符,注意,str2的K度不大于str1,否则需要重新输入。 例如,如果输入strl;=“abced”,str2=“fk”,则输出“fkced”。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仪在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: #include<stdio.h> #include<string. h> main () char strl [ 81], str2 [ 81 ]; char *pl=strl, *p2=str2; clrscr (); do printf(" Input strl tn"); gets (strl); printf(" Input str2 In"); gets (str2); while(【1】); while(【2】) *p1++=*p2++; printf(" Display strl /n"); puts (【3】)
填空题下列程序的功能是计算机平均成绩并统计90分以上的人数。 main ( ) int n,m; float grade, average; average=n=m= 【13】 ; while( 【14】 ) scanf("%f", if (grade<0) break; m++; average+=grade; if (grade<90) 【15】 ; m++; ) if(n) printf("%.2f %d/n",average/n,m);
填空题C语言用于结构化程序设计的3种基本结构是______、选择结构和循环结构。
填空题有以下程序 main() int n=0,m+1,X=2; if(!n) X-=l; if(m) X-=2; if(X) X-=3; printf("%d/n",x); 执行后输出的结果是 【9】 。
填空题下面程序的运行结果是 【12】 。 #include <stdio.h> fun(int t[],int n) int i,m; if(n==1) return t[0]; else if(n>=2) | m:fun(t,n-1); return m; main( ) int a[ ] = 11,4,6,3,8,2,3,5,9,2; printf( "% d /n" ,fun( a, 10));
填空题以下程序的运行结果是______。 #define A 4 #define B(x)A*x/2 main() float c,a=8.0; c=B(a); printf("%f/n",c);
填空题请补充函数fun(),该函数的功能是:把ASCII码为奇数的字符从字符串str中删除,结果仍然保存在字符串str中。字符串str从键盘输入,其长度作为参数传入函数fun()。
例如,输入“abcdef”,输出“bdf”。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。
试题程序:
#include <stdio.h>
#define N 80
void fun(char s[],int n)
{
int i, j;
j=0;
for(i=0;{{U}} 【1】 {{/U}};i++)
{
if({{U}} 【2】 {{/U}})
s [j++]-s [i];
}
{{U}} 【3】 {{/U}};
}
main ( )
{
int i=0, strlen=0;
char str [N];
clrscr ();
printf ("/nInput a string: /n");
gets (str);
while (str [i] !='/0')
{
strlen++;
i++;
}
fun(str, strlen);
printf("/n*** display string ***/n");
puts (str);
}
填空题有以下程序
main( )
{ int t=1,i=5;
for(;i>=0;i--) t*=i;
printf(“%d\n”,t);}
执行后输出结果是【 】。
填空题请补充函数proc(),该函数的功能是:分类统计一个字符串中元音字母和其他字符的个数(不区分大小写)。
例如,输入imnIaeouOWC,结果为:A:1 E:1 1:2 O:2U:1 other:4。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#define M 100
void proc(char *str,int bb[])
{
char *p=str;
int i=0;
for(i=0; i<6; i++)
______;
while(*p)
{
switch(*p)
{
case "A":
case "a": bb[0]++; break;
case "E":
case "e": bb[1]++; break;
case "I":
case "i": bb[2]++; break;
case "O":
case "o": bb[3]++; break;
case "U":
case "u": bb[4]++; break;
default: ______;
}
______
}
}
void main()
{
char str[M],ss[6]="AEIOU";
int i;
int bb[6];
system("CLS");
printf("Input a string:/n");
gets(str);
printf("the string is:/n");
puts(str);
proc(str, bb);
for(i=0; i<5; i++)
printf("/n%c: %d", ss[i], bb[i]);
printf("/nother: %d", bb[i]);
}
填空题以下程序运行后的输出结果是 【14】 。 #include <stdio.h> main( ) int a[4] [4]= 1,2,3,4, 5'6'7'8,11'12'13'14,15'16'17'18 ; int i=0,j =0,s =0; while(i ++ <4) if(i ==2 [[ i ==4) continue; j=0; do s+ = a[i][j]; j++; while(j<4); pdnff(" % d'/n" ,s);
填空题下列程序的输出结果是 【6】 。 #define PR(a)printf("%d/t",(int)(a)) #define PRINT(a)PR(a);printf("ok!") main() int i,a=1; for(i=0;i<3;i++) PRINT(a+i); printf("/n");
填空题计算机中存储容量的基本单位是字节,它的英文名称是 【1】。
