程序填空docWord文档下载推荐.docx
- 文档编号:20274597
- 上传时间:2023-01-21
- 格式:DOCX
- 页数:13
- 大小:17.10KB
程序填空docWord文档下载推荐.docx
《程序填空docWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《程序填空docWord文档下载推荐.docx(13页珍藏版)》请在冰豆网上搜索。
voidmain()
{intn=0,c;
c=getchar();
/**********found**********/
while(c!
='
\n'
)
{
/**********found**********/
if(c>
0'
&
c<
9'
)n++;
}
printf("
%d"
n);
2.#include<
stdlib.h>
#include<
voidmain()/*×
¢
Ò
â
º
²
ª
Þ
É
¾
{staticcharss[4][3]={'
A'
'
a'
f'
c'
B'
d'
e'
b'
C'
g'
D'
};
intx,y,z;
for(x=0;
x<
=3;
x++)
/**********found**********/
for(y=0;
y<
=2;
y++)
{z=x+y;
if(z==3)
printf("
%c"
ss[x][y]);
}
3.#include<
intmain()
charstr[81],*p=str;
intlen=0;
gets(p);
while(*p!
\0'
)
{
if(*p>
*p<
z'
)
len++;
p++;
len=%d\n"
len);
return0;
4.#include"
stdio.h"
{inta[10],i,f=-1;
for(i=0;
i<
10;
i++)
scanf("
&
a[i]);
for(i=1;
if(a[i]==a[0]){f=i;
break;
f);
}
5./*Ì
¹
«
Á
ù
ó
°
Ù
6µ
Ý
±
0Ê
{longintnum;
%ld"
num);
do{
if(num/100%10==6)/*»
if(num%1000/100==6);
*/
%ld\n"
num);
while(!
num==0);
/*while(num!
=0);
*/
6.#include<
{inta[2][4]={1,3,5,7,2,4,6,8},b[4][2];
inti,j;
for(i=0;
2;
for(j=0;
j<
4;
j++)
b[j][i]=a[i][j];
%2d%2d\n"
b[i][0],b[i][1]);
7.#include<
string.h>
{chara1[20],a2[20];
intl1,l2,num;
gets(a1);
gets(a2);
l1=strlen(a1);
l2=strlen(a2);
num=(l1<
l2)?
l1:
l2;
8.#include"
{inti,j;
for(i=0;
{j=i*10+6;
if(i%3!
=0)continue;
%d"
j);
9.#include<
voidmain()/*×
inti;
intf[10]={1,1};
for(i=2;
f[i]=f[i-2]+f[i-1];
{if(i%5==0)printf("
\n"
);
%6d"
f[i]);
}
10./*Ç
¦
Ü
1+2!
+3!
+¡
+N!
{inti,n;
longs=0,t=1;
scanf("
n);
for(i=1;
=n;
t=t*i;
s=s+t;
1!
+2!
...+%d!
=%ld\n"
n,s);
11.#include<
{inta,b,c,i;
a=c=0;
=10;
{scanf("
b);
if(b%2==0)
a=a+b;
elsec=c+b;
=%d\n"
a);
c);
12.#include<
{inti=1,j;
doublescore[4],sum=0;
doubleratio[4]={0.1,0.2,0.2,0.5};
j<
j++)
{scanf("
%lf"
score[j]);
sum+=score[j]*ratio[j];
sum=%.2lf\n"
sum);
1.#include<
floatavg(float*a,intn)
{inti;
floatavg;
avg=0.0;
i<
n;
i++)
avg+=*a++;
avg/=n;
returnavg;
floata[5]={1.0,3.0,4.0,5.0,7.0};
floataverage=avg(a,5);
average=%.2f\n"
average);
2.#include"
voiddele(char*s)
{intn=0,i;
s[i];
if(s[i]>
s[i]<
s[n++]=s[i];
s[n]='
;
{chars[80];
gets(s);
dele(s);
puts(s);
3.#include"
#include"
string.h"
voidfun(char*w,intm)
{chars,*p1,*p2;
p1=w;
p2=w+m-1;
while(p1<
p2)
{s=*p1;
*p1=*p2;
*p2=s;
p1++;
p2--;
{chara[80];
gets(a);
fun(a,strlen(a));
puts(a);
#defineM10
voidmain()
{inta[M],i,j,n;
M;
i++)scanf("
n=M-1;
for(i=M-1;
i>
0;
i--)
{if(a[i]==a[i-1])
{
for(j=i;
/**********found**********/
a[j-1]=a[j];
n--;
printf("
%3d"
a[i]);
5./*4202²
Ï
ñ
Ë
Ø
math.h"
intn,i,flag,k;
do
while(n<
2);
/*Î
¤
Ú
1µ
*/
k=sqrt(n);
for(i=2,flag=1;
=k&
flag;
if(n%i==0)flag=0;
/*flagÎ
0±
í
n²
if(flag)
yes"
else
no"
6.#include"
{chars1[20]="
xy"
s2[]="
ab12DFc3G"
*t1=s1,*t2=s2;
while(*t1!
)t1++;
while(*t2!
{if(*t2>
*t2<
{*t1=*t2;
t1++;
t2++;
*t1='
puts(s1);
7.#include"
#include"
voidmain()
chars[81],*p1,*p2;
intn;
gets(s);
n=strlen(s);
p1=s;
p2=s+n-1;
while(p1<
p2)
if(*p1!
=*p2)break;
else{p1++;
if(p1<
p2)printf("
NO\n"
elseprintf("
YES\n"
8.#include<
voidmain()
{inta[10],i,j,k,t;
a+i);
9;
i++)
{k=i;
for(j=i+1;
if(*(a+j)<
*(a+k))k=j;
{t=*(a+i);
*(a+i)=*(a+k);
*(a+k)=t;
*(a+i));
voidfun(char*s,char*t)
inti,d;
d=strlen(s);
/************found************/
d;
i++)t[i]=s[i];
i++)t[d+i]=s[d-1-i];
t[2*d]='
chars[100],t[100];
%s"
s);
fun(s,t);
t);
10.#include<
#defineN9
voidfun(inta[],intn)
{inti,t,p;
p=(n%2==0)?
n/2:
n/2+1;
n/2;
i++)
t=a[i];
a[i]=a[p+i];
a[p+i]=t;
intb[N],i;
N;
i++)scanf("
b[i]);
fun(b,N);
i++)printf("
b[i]);
11.#include"
{FILE*fp;
chardat[20];
if((fp=fopen("
LI.txt"
"
r+"
))==NULL)
error!
elsefor(i=0;
20;
{dat[i]=fgetc(fp);
dat[i]);
fclose(fp);
12.#include<
#defineN5
structstudent
intid;
charname[20];
floatscore;
}stu1[N]={{101,"
LiPing"
48},
{102,"
ZhangHua"
92},
{103,"
HeWei"
78.5},
{104,"
ZhaoPu"
55},
{105,"
WuKai"
76}};
¯
inti,c=0;
floatave,s=0;
s+=stu1[i].score;
if(stu1[i].score<
60)c+=1;
ave=s/N;
average=%6.2f\ncount=%2d\n"
ave,c);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 程序 填空 doc