填空题以下程序运行后的输出结果是{{U}} {{/U}}。 main() int a=1,b=3,c=5; if(c=a+b) printf("yes//n"); else printf("no//n");
填空题下面程序输出的结果是______。
main()
{ int i;
int a[3][3]={1, 2, 3, 4, 5, 6, 7, 8, 9};
for(i:0; i<3; i++)
printf("%d", a[2-i][i]);}
填空题以下程序的输出结果是{{U}} 【10】 {{/U}}。
#include <stdio.h>
#define N 5
int fun(int *s,int a,int n)
{ int j;
*s=a j=n;
while(a!=s[j]) j-;
return j;
main()
{ int s[N+1]; int k:
for(k=1 ;k<=N;k++) s[k]=k+1:
print f("%d/n",fun(s,4,N));
}
填空题表达式10+'a'+1.5-0.5*'B'的结果是{{U}} 【7】 {{/U}}。
填空题以下程序的运行结果为 【8】 。#define FORMAT "%u,%u"main() int a[3][4]=1,3,5,7,9,11,13,15,17,19,21,23; printf("/n"); printf(FORMAT,**a,*a[0]); printf(FORMAT,*(a[0]+1),*&a[0][1]); printf(FORMAT,a[1][0],*(*(a+1)+0));
填空题有以下结构体说明和变量的定义,且指针p指向变量a,指针q指向变量b,则不能把结点b连接到结点a之后的语句是______。 struct node char data; struct node *next;a,b
填空题在长度为n的线性表中,寻找最大项至少需要比较{{U}} (2) {{/U}}次。
填空题请补充main()函数,该函数的功能是:输出一个4×4的矩阵,要求必须使用行指针表示输出变量。 注意:部分源程序已给出。 请勿改动主函数main和其他函数中的任何内容,仅在main()函数的横线上填入所编写的若干表达式或语句。 试题程序: #include<stdlib.h> #include<stdio.h> void main() static int arr[4][4]=(9,8,7,6), 6,5,4,3, 3,2,1,0, 2,4,6,8; int(*p)[4],j,i; p= (1) ; system("CLS"); for(i=0;i<4;i++) printf("/n/n"); for(j=0;j<4;j++) printf("%4d", (2) );
填空题以下程序中,函数SumColumMin的功能是:求出M行N列二维数组每列元素中的最小值,并计算它们的和值。和值通过形参传回主函数输出。请填空。
#define M 2
#define N 4
void SumColumMin(int a[M][N],int *sum)
{ int i,j,k,s=0;
for(i=0;i<N;i++)
{ k=0;
for(j=1;j<M;j++)
if(a[k][i]>a[j][i])k=j;
s+={{U}} 【18】 {{/U}};
}
{{U}} 【19】 {{/U}}=s;
}
main()
{ int x[M][N]={3,2,5,1,4,1,8,3},s;
SumColumMin({{U}} 【20】 {{/U}});
printf("%d/n",s);
}
填空题下面程序的运行结果是______。 int f( int a[], int n) if(n>1) return a[0]+f(&a[1],n-1); else return a[0]; main () int aa[3]=1,2.3,s; s=f(&aa[0],3); printf("%d/n",s);
填空题函数pi的功能是根据以下公式近似求得的: pi*pi/6=1+1/(2*2)+1/(3.3)+...+1/(n*n) 请在下面的函数中天空,完成求pi的功能。 #include<math.h> double pi(long n) double s=0.0,long i; for(i=1;i<<=n;i++)s=s+ 【11】 ; return(sqrt(6*s));
填空题请补充main函数,该函数的功能是:打印出1~1000中满足:个位数字的立方等于其本身所有数。
本题的结果为;1 64 125 216 729
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数main的横线上填入所编写的若干表达式或语句。
试题程序:
#include <stdio .h>
main ( )
{
int i,g;
clrscr ();
for (i=1; i<1000; i++)
{
g={{U}} 【1】 {{/U}};
if({{U}} 【2】 {{/U}})
printf ("%4d", i);
}
}
填空题以下程序段的输出结果是______。 main() int a=2,b=3,c=4; a*=16+(b++)-(++c); printf("%d",a);
填空题数据库管理系统是位于用户与{{U}} 【5】 {{/U}}之间的软件系统。
填空题以下程序的输出结果是( )。
#include
mian()
{ int a=37;
a+=a%=9; printf(“%d\n”,a);
}
填空题以下函数把b字符串连接到a字符串的后面,并返回a中新字符串的长度。请填空。
strcen(char a[],char b[])
{ int num=0,n=0;
while(*(a+num)! ={{U}} 【15】 {{/U}})num++;
while(b[n]){*(a+num)=b[n];num++;{{U}} 【16】 {{/U}};}
return(num);
}
填空题请补充函数fun(),该函数的功能是:把一个字符串中的字符(字母)按从小到大排序,并把这个全部由字母组成的字符串保存在原串中,函数返回这个字符串的长度。例如;输入“cixbr2.3”,如果为bcirx,字符串长度为5。
注意:部分源程序给出如下.
请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。
#include <stdio.h>
#define N 20
int fun (char *str)
{
int i=0,j=0,k=-0,m=0;
char t;
char *p=str;
while(*p)
{
if((*p>='A'
}
*(str+i)='/0';
{{U}} {{U}} {{/U}} {{/U}};
while(*(p+j))
{
k=j;
{{U}} {{U}} {{/U}} {{/U}};
while (*(p+k))
{
if(*(p+k)<*(str+m)
{
t=*(str+m);
*(str+m)=*(p+k);
*(p+k)=t;
}
k++;
}
j++;
}
return i; }
main()
{
char str[81];
iht n;
clrscr();
printf("Input the original string ");
gets(str);
printf("*** The Original string ***In");
puts(str);
printf("*** The nwe string ***/n");
n=fun(str);
puts(str);
printf("***The length of new string is:
%d***/n",n);
}
填空题一棵二又树的中序遍历结果为DBEAFC,前序遍历结果为ABDECF,则后序遍历结果为______。
填空题下列程序的功能是将字符串s中所有的字符c删除。请填空。 #include<stdio.h> main() char s[80]; int i,j; gets(s); for(i=j=0;s[i] !='/0';i++) if(s[i] !='c')______; s[j]='/0'; puts(s);
填空题软件设计模块化的目的是______程序设计的复杂性。
