C语音模拟题1.docx
《C语音模拟题1.docx》由会员分享,可在线阅读,更多相关《C语音模拟题1.docx(25页珍藏版)》请在冰豆网上搜索。
C语音模拟题1
A
C
D
A
A
A
A
B
D
D
B
B
B
D
D
A
D
B
D
A
A
D
B
B
C
A
B
A
A
D
B
D
C
B
B
C
D
A
C
#include
#include
main()
{chars[80],t[80];
inti,sl;
printf("\nPleaseenterstrings:
");
scanf("%s",s);
sl=strlen(s);
/************found************/
for(i=0;i<=sl;i+=2)//改为:
for(i=0;i<=sl;i++)
t[i]=s[i];
for(i=0;it[sl+i]=s[sl-i-1];
/************found************/
t[sl]='\0';//改为:
t[sl+sl]='\0';
printf("Theresultis:
%s\n",t);
}
#include
main()
{intM,t,i,M1,n=0;
printf("Pleaseenteranumber:
");
scanf("%d",&M);
/************found************/
for(____
(1)____;t++)填入:
t=1;t<=M;
{
M1=t/2;
for(i=2;iif(M1%i==0)break;
/************found************/
if(i==M1_____
(2)_______)填入:
&&t%2==0
{printf("%d=%d+%d",t,M1,M1);n++;}
if(n%5==0)printf("\n");
}
#include
voidNONO(void);
intfact(inti)
{
intp,j;
/***********begin***********/
p=1;
for(j=1;j
p=p*j;
/***********end************/
returnp;
}
main()
{
intm,n,s;
/***********begin***********/
m=10;
n=4;
s=fact(m)/(fact(n)*fact(m-n));
/***********end************/
printf("s=%d\n",s);
NONO();
}
voidNONO(void)
{
FILE*wf;
ints;
wf=fopen("out1.dat","w");
s=fact(10)/(fact(4)*fact(6));
fprintf(wf,"s=%d\n",s);
fclose(wf);
}