更多"#include<stdio.h>
#include<conio"的相关试题:
[单项选择]有以下程序
#include
#include
main( )
{ char a[5][10]={ "china","beijing","you","tiananmen","welcome"};
int i,j; char t[10];
for(i=0;i<4;i++)
for(j=i+1;j<5;j++)
if(strcmp(a[i],a[j])>0)
{strcpy(t,a[i]); strcpy(a[i],a[j]); strcpy(a[j],t);}
puts(a[3]);
}
程序运行后的输出结果是_______。
A. beijing
B. china
C. welcome
D. tiananmen
[填空题]#include<stdio.h>
#include
main( )
int i,a[10];
char b[10];
for(i=0;i<10;++i)
scanf("%d",a+i);
b="10 number":
printf("%s/n",b);
for(i=0;i<10;++i)
printf("%d";a[i]);
printf("/n");
错误:______
改正:______
[单项选择]有以下程序
#include
main( )
{FILE *fp; int i;
char ch[]="abcd",t;
fp=fopen("abc.dat", "wb+");
for(i=0;i<4;i++)fwrite(&ch[i],1,1,fp);
fseek(fp,-2L,SEEK_END);
fread(&,1,1,fp);
fclose(fp);
printf("%c\n",t);
}
程序执行后的输出结果是【 】。
A. d
B. c
C. b
D. a
[单项选择]有以下程序
#include
main( )
{struct STU{char name[9];char sex;double score[2]; };
struct STU a={"Zhao",m’’,85.0,90.0},b={"Qian",f’’,95.0,92.0};
b=a:
printf("%s,%c,%2.0f,%2.0f/n",b.name,b.sex,b.score [0],b.score[1]);
}
程序的运行结果是
A. Qian,f,95,92
B. Qian,m,85,90
C. Zhao,f,95,92
D. Zhao,m,85,90
[填空题]以下程序的输出结果是【 】。
#include
main( )
{ int i,j,sum;
for(i=3;i>=1;i--)
{ sum=0;
for(j=1;j<=i;j++) sum+=i*j;
}
printf("%d/n",sum);
}
[单项选择]有以下程序
#include
main( )
{FILE * fp;int k , n,a[6]={1,2,3,4, 5,6};
fp=fopen("d2.dat","W");
fprintf(fp,"%d%d%d\n",a[0],a[1],a[2]);fprintf(fp,"%d%d%d\n",a[3],a[4],a[S]);
fclose(fp);
fp=fopen("d2.dat","r");
fscanf(fp,"%d%d",&k,.&n);printf("%d%d\n",k,n);
fclose(fp);
}
程序运行后的输出结果是【 】。
A. 12
B. 14
C. 1234
D. 123456