版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1.±aDzO-Eyfun,o-EypA1|AUEQ:.u^YOOIA1?Ei^i^jEEas,MlEa^axux-i-ta°-EyOp-p?
0;nl"^DI21z?Ee;£
S=l+1/(1+2)+1/(1+2+3)+j-+1/(1+2+3+j-+n)
AyE?,EonpAOptallE±,o-EypAdpia1.833333j£
xida:2i-OO,3iDd,03dEQlAi£
Cei3,A3I-main0-Ey0lffiaEu0-EyODpAEi0iAUEY,^b6u0-EyfunpA?"A-0AODiiEeEu
±aD'pAEo,EOi^a,£
EOia3IDd:
?include<conio.h>
#include<stdio.h>
?include<string.h>
#include<stdlib.h>
floatfun(intn)
)
voidmain()
(
FILE*wf;
intn;
floats;
system(nCLSH);
printf("\nPleaseenterN:");
scanf("%d",&n);
s=fun(n);
printf("Theresultis:%f\n”,s);
/**********★**************★★★**/
wf=fopen("out.dat",Hwn);
fprintf(wf,"%f”,fun(11));
fclose(wf);
/*****************************/
)
飛。,比
floatfun(intn)
(
intizsl=0;
floats=0.0;
for(i=l;i<=n;i++)
(
sl=sl+i;
s=s+l.0/sl;
)
returns;
)
2.Qe±aD,d?,bo-Eyvoidfun(char*tt,int
pp[]),I3^OUttx0-u,?dD"a"p^"z"26.6xOA.,^-x63oI0pA,lEy,2<:OA,t?AoUppE
uO^EyxeOD?£
AyE?,p±EaEexd?u"?abcdefghabcdeabc06,3ifidpAEa3d^a1u6|.AEQ:333221
110000000000000000000
x?Oa:2i-OO-3iDd.03dE<?iA[£
Cei3,A3I-main0-Ey0IffiaEu0-EyODpAEi0iAUEY,ilb6u0-EyfunpA?"A-0AdDiiEeEu
laD^pAEo.EOi^aiE
E6ia3tDd:
#include<conio.h>
#include<stdio.h>
ttinclude<stdlib.h>
voidfun(char*ttzintpp[])
(
)
voidmain()
(
FILE*wf;
charaa[1000];
intbb[26],k;
system("CLSH);
printf("\nPleaseenteracharstring:");
scanf("%s",aa);
fun(aa,bb);
for(k=0;k<26;k++)
printf(H%d”,bb[k]);
printf(n\n");
/★********★*★**************★★**/
wf=fopen("out.datn,nwn);
fun("abcdefgabcdeabc”,bb);
for(k=0;k<26;k++)
nH
fprintf(wfz%d,bb[k]);
fclose(wf);
/*********★★******************/
)
,ij
voidfun(char*ttzintpp[])
inti;
for(i=0;i<26;i++)
pp[i]=0;
for(;*tt!=*\01;tt++)
ifa'*z1)
pp[*tt-,a,]++;
)
z13z2
3.Qe±aD°-Eyfun,EiipA;AUEQ:Q6ossEud,xO?u?0D0431><0-upA4dEyz-p?0
zEO|ii£
z3
AyEQzEoEaEexO?u@123412132,EaEe^O-ulzOdEad3?£
2Z33
x<:Oa:c-OO1?0500£<;1^|£
-ooo-oc>o
QeidiASlmain-EyIjEaEuEy0£)pAEiiAUEY,4b6u-EyfunpA?"A"A0DiiEeELi
iaD^AEo.EOi^ait
EOia3IDd:
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#defineM81
intfun(char*ss,charc)
(
)
voidmain()
(
FILE*wf;
chara[M],ch;
system(“CLS“);
printf(n\nPleaseenterastring:");
gets(a);
printf("XnPleaseenterachar:H);
ch=getchar();
printf(n\nThenumberofthecharis:%d\n”,fun(arch));
/★*★*****★★★**************★****/
wf=fopen(Hout.dat",HwH);
fprintf(wf,n%dn,fun(“123412132",'1'));
fclose(wf);
/*********★★★************★★★★*/
)
[獷九/飛。,
intfun(char*ss,charc)
inti=0;
for(;*ss!=*\01;ss++)
if(*ss==c)
i++;
returni;
13。-3
4.Qe±aD'0?,b°-Eyfun,EtipA[AUEQ:Q6blp^m(1ni)0?AUAU±?7?dllSuypAEuO
1
DOuEy?AOUEyxeaOD,I**yn-p?0OaD?EypA4dEyj£
za33
AyEQ,E6?,0mpAOpt50f6dtDdEao:
711142122283335424449
X33
x<:Oa:-OOIDd40bEQlAi£
-o-oo-oo-o
Cei<3JATmainEyI^aEuEy0DpAEiiAUEY<^d0UEyfunpA?"A-A0DiiEeEu
±aD'pAEo,EOi^aj£
E6ia3IDd:
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#defineM100
voidfun(intm,int*a,int*n)
(
}
voidmain()
(
FILE*wf;
intaa[M],n,k;
system(nCLSn);
fun(50,aa,&n);
for(k=0;k<n;k++)
3
if((k+1)%20==0)/*AeDDEab20AoEy*/
H
{printf(%4d"zaa[k]);
printf(H\nn);
)
else
H
printf(%4d"zaa[k]);
printf("\nH);
/**********★*******************/
wf=fopen("out.datn,HwH);
for(k=0;k<n;k++)
fprintf(wf,n%4dH,aa[k]);
fclose(wf);
/*****************************/
)
[切飛。,i±
voidfun(intm,int*a,int*n)
(
intizj=0;
for(i=l;i<=m;i++)
if(i%7==0||i%ll==0)
a[j++]=i;
*n=j;
5.Qe±aD'o-Eyfun,JEa1;AUEQ:dA^t?EypAOyOuEya]tb012<:3E0??bOuEy-A6
UcODi£°I2CpA?:^?aEypAE@I?°I,di?EyOA'I?AOUcEypAE?i?°IQ§t?Ei,bE
ypAE@I?°I,6I?EyOAI-AoUcEypA^ol?°I°UI?EIi£
AyEQ,口土a=45,b=12,p^-6A,Ao-Ey°6,c=5241\£
2Z33
x<:0a:c-OdiDdi0bEQlAi£
CetS.ASI-maino-EyoI^aEuo-Ey0£)pAEt°IAUEY,^b6uo-EyfunpA?"A"°AODtiEeEu
iaD^pAEo.EOi^ajL
EOIa3IDd:
#include<stdio.h>
#include<conio.h>
voidfun(inta,intbzlong*c)
(
)
voidmain()
(
inta,b;
longc;
FILE*out;
printf("Inputa,b:H);
scanf("%d%d”,&a,&b);
fun(a,b,&c);
printf("Theresultis:%ld\n'\c);
/女★★★★★★***★★★★****★★★★****★★★★/
nHn
out=fopen("out.datfw);
fun(a+11,b+22,&c);
n
fprintf(out,%ld\n"fc);
fclose(out);
}
j%2j&W,j之
voidfun(inta,intb,long*c)
{
*c=(a%10)*1000+(b%10)*100+(a/10)*10+b/10;
)
6.Ce±aD/o-Eyfun,EupA1lAUEQ^EEa:
s=(ln(l)+ln(2)+ln(3)+;-+ln(ni))a->a?0.5aa
OUCOiNOODeEp^-bAlog(n)°-EyC61n(n),£
AyEQ,EompAOpta20,Odfun0-EyOpta6.506583j£
xtda:2e-O6Z3iDd,03bEQlAi£
QeiS,AH-main°-EyoIjEaEuo-Ey0DpAEioiAUEY,iid6uo-EyfunpA?"A''oA0fiiiEeEu
iaD^AEo^Ebi^ait
EOIa3tDd:
?include<conio?h>
?include<stdio.h>
#include<math.h>
?include<stdlib.h>
doublefun(intm)
)
voidmain()
(
FILE*wf;
system(”CLS“);
printf(n%f\nfun(20));
/1A1*****************************/
wf=fopen("out.dat",HwH);
nn
fprintf(wf,%fzfun(20));
fclose(wf);
/*****************************/
)
doublefun(intm)
(
inti;
doubles=0.0;
for(i=l;i<=m;i++)
s=s+log(i);
returnsqrt(s);
)
O-123
7.±aD'Eyfun,EiipA;AUEQ:QonOOAU(?°uA-n)I-1E±AU±?5Oe1lOuypAEuODxQ
o2ao-
E?Eyd@tpA^-^iusz<:x4-IEyOp-p?0j£
a-a
AyE<?zni1000E±,°EyOpO|ts=96.979379i£
x,6含:2e-0dz3106,030£^1&1£
o-oo-oo,o
QeI5>A^rmainEyIjEaEuEy0£)pAEiiAUEY,^b6u-EyfunpA?"A'A0DiiEeEu
iaD^pAEo.EOi^aiE
EOia3IDd:
#include<conio.h>
?include<math.h>
?include<stdio.h>
#include<stdlib.h>
doublefun(intn)
voidmain()
(
FILE*wf;
system(nCLSH);
printf(Hs=%f\nn,fun(1000));
/******************************y
wf=fopen("out.dat“,"w");
fprintf(wf,n%fM,fun(1000));
fclose(wf);
/文*★*******★*****★*********★★★/
)
Wf-"
doublefun(intn)
{doubles=0.0;
inti;
for(i=0;i<n;i++)
if(i%5==0&&i%ll==0)
s=s+i;
s=sqrt(s);
returns;
)
8.Qe±aDzO-Eyfun,j£a1;AUEQ:h?EuOD'6601?iOUOuEympA-QE0Ey'aeEexxEuO,Eyx
1
eOD,?QE0EypA4oEyt"yk"??0\£
3
AyEQzEaEe17zOdO|Ea646891012141516j£
金:2「06'配工工£
ooo-oo-o
QeIdiAqrmain-EyIJEaEuEy0DpAEiiAUEYz^b6uEyfunpA?"A"A0DiiEeEu
iaD^pAEo.EOi^aiE
EOIa3IDd:
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
voidfun(intm,int*k,intxx[])
(
)
voidmain()
(
FILE*wf;
intm,n,zz[100];
system(HCLSH);
printf(M\nPleaseenteranintegernumberbetween10and100:H);
scanf(n%dn,&n);
fun(n,&m,zz);
printf("\n\nThereare%dnon-primenumberslessthan%d:",m,n);
for(n=0;n<m;n++)
HH
printf(\n%4dfzz[n]);
/******************************y
wf=fopen("out.dat",HwH);
fun(17,&m,zz);
for(n=0;n<m;n++)
fprintf(wf,"%4d”,zz[n]);
fclose(wf);
/★★*******★★★************★***文/
)
voidfun(intm,int*k,intxx[])
(
inti,j,n=0;
for(i=4;i<m;i++)
{for(j=2;j<i;j++)
if(i%j==0)break;
if(j<i)xx[n++]=i;
)
*k=n;
)
±aD'o-Eyfun,EupA1;AUEQ:,u^YOOIA1?E^QoppAOp,1uOE°-EyOp'0?0i£m6ent
dOyEyqddaQ6m>n,£P(guān)=m!/(n!(m-n)!),AyEQ,m=12,n=8E±,OEDD^a1uIa495.
000000;£
xida:2i-OO,3iDd,03dEQlAi£
Cei3,A3I-main0-Ey0lffiaEu0-EyODpAEi0iAUEY,^b6u0-EyfunpA?"A-0AODiiEeEu
±aD'pAEo,EOi^a,£
E6±a3IDd:
?include<conio.h>
#include<stdio.h>
?include<stdlib.h>
floatfun(intm,intn)
(
)
voidmain()
(
FILE*wf;
system(nCLSn);
Hn
printf(p=%f\nzfun(12,8));
/******************************/
wf=fopen("out.dat",HwH);
fprintf(wf,H%f",fun(12,8));
fclose(wf);
/★★★★*****★★★****★★★*****★★★★文/
)
i%2露才0。,比
floatfun(intm,intn)
(
inti;
doublep=l.0;
for(i=l;i<=m;i++)
p=p*i;
for(i=l;i<=n;i++)
p=p/i;
for(i=l;i++)
p=p/i;
returnp;
)
56±30?,0°-Eyfloatfun(double
h),o-EypA1;AUEQ:SIO±aAehODpAOp±£A6A^i?DiEy,2<:HOpUEyi?^0DDEAEataEe(1
aeSfhODpAOpta0yEy)j£
AyEQzE6h
aaaao-
Opt8.32433zOd°-Ey-p?08.32;E6hOpt8.32533,0dEy-p?08.33j£
x<:Oa:2c-O0z
ooo-oo-o
QeIdiAqrmain-EyIjEaEuEy0DpAEiiAUEYz^b6uEyfunpA?"A"A0DiiEeEu
iaD^pAEo.EOi^aiE
EOia3IDd:
#include<stdio.h>
?include<conio.h>
#include<stdlib.h>
floatfun(floath)
(
)
voidmain()
(
FILE*wf;
floata;
system(HCLSH);
printf("Entera:n);
scanf("V,&a);
printf("Theoriginaldatais:H);
printf(n%f\n\nH,a);
printf("Theresult:%f\n",fun(a));
/**********★*******************/
wf=fopen("out.dat",nwH);
fprintf(wf,”,fun(8.32533));
fclose(wf);
/**★**************************/
}
i%214力。/士
floatfun(floath)
(
longt;
t=(h*10004-5)/10;
return(float)t/100;
z13aa-
Qe±aD°-Eyfun,°-EypA|AUEQ:Qod1It>I->EyxeOU±BOE0O?°Izx4-I°EyOp-p?0
i£5^I^EyxeODpAdpOUO^-°-EyO£),36ej£
AyEQ,E6^It>i-.EyxeODpAOpia
13579
29994
69998
13570
Od°-EyOpta61i£
金:2「06'配工工£
ooo-oo-o
QeIdiAqrmain-EyIJEaEuEy0DpAEiiAUEYz^b6uEyfunpA?"A"A0DiiEeEu
iaD^pAEo.EOi^aiE
EOia3IDd:
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#defineM4
#defineN5
intfun(inta[M][N])
(
)
voidmain()
(
FILE*wf;
intaa[M][N]={{1,3,5,7,9},{2,9,9,9,4},{6,9,9,9,8},{l,3,5,7,0}};
inti,j,y;
system(nCLSH);
printf("Theoriginaldatais:\nn);
for(i=0;i<M;i++)
{for(j=0;j<N;j++)
printf("%6dn,aa[i][j]);
printf(H\nn);
)
y=fun(aa);
printf(n\nThesun:%d\n”,y);
printf(H\nH);
/******************************/
wf=fopen("out.dat",HwH);
fprintf(wf,"%d”,y);
fclose(wf);
/*****************************/
)
intfun(inta[M][N])
(
inti,j,sum=0;
for(i=0;i<M;i++)
for(j=0;j<N;j++)
if(i==0||i==M-l||j==0||j==N-l)
sum=sum+a[i][j];
returnsum;
)
±aDO-Eyftin,EiipA1;AUEQ:AuOAOOIAEuE^pA^dp¥puzu?--Qo-^^cos(x)-x=0
pAO?,dEp,ui£
xn+l=cos(xn)
puzu2^0eEQlA:
(1)Ejxl3odpta0.0;
3
(2)xO=xlz°NxlpAOp,,0x0;
(3)xl=cos(xO),Q63bO?,dDApAxl;
z2
(4)E6xO-xl,pA^0SIOOpDiOUO.000001z0d0DD^0e(5),-nOdO^D^e(2);
3a
(5)EuQ6xl^IEQ-^tcos(x)-x=0pAO?4bEp,u,^-gyOp-p?0j£
3IDd^?Ea3b^a1uRoot=0.739085i£
2z33
xCOa:e-OOIDd40bEQlAi£
-0-00-00-0
QeidJATmainEyI£aEuEyODpAEIiAUEY,^dOUEyfunpA?-A-AODiiEeEu
iaD^AEo.EOi^ajE
EOIa3if)d:
#include<stdio.h>
#include<conio.h>
?include<math.h>
floatfun()
(
)
main()
(
FILE*out;
floatf=fun();
Mn
printf(Root=%f\nzf);
/******************************/
out=fopen(nout.dat",nw");
fprintf(out,”%f”,f);
fclose(out);
/*****************************★I
)
floatfun()
(
floatxl=0.0,xO;
do
x0=xl;
xl=cos(xO);
}while(fabs(xO-xl)>=le-6);
returnxl;
MU^'EaEepAxO-u,?ODO?°u°-,xOA,0I*°Ai£Qe±aD,o-Eyfun,EUpA1|AUEQ:ii?xo-u
'?ODpAQ°vm*°AE?2iE^3y,ODMa°t06A?)JA*°A2??為3y;£
AyEQ,E6x0-ux?0DpAAUEYIa****A*BC*DEF*G*******,E^3y°6,xQ-u^DpAAUEY
6d6;p±ECA*BC*DEF*G*******i£
xtda:2i-OO-3tfid.03dEQlAi£
Qei3.A^-main0-Ey0IffiaEu0-EyODpAEi0iAUEY,hb6u0-EyfunpA?"A-0AODiiEeEu
±aD"pAEo,EOi^ai£
E6ia3IDd:
ttinclude<stdio.h>
#include<conio.h>
voidfun(char*a)
(
)
voidmain()
(
FILE*wf;
nn
chars[81]zt[81]=****A*BC*DEF*G*******;
printf("Enterastring:\nH);
gets(s);
fun(s);
printf("Thestringafterdeleted:\nn);puts(s);
/1A1*****************************/
wf=fopen("out.dat",HwH);
fun(t);
fprintf(wf,H%sn,t);
fclose(wf);
/*****************************/
)
voidfun(char*a)
(
char*p=a;
while(*p==1*1)
P++;
for(;*p!=1\01;p++,a++)
*a=*p;
*a=,\0,;
)
O-o-1Za-
Qe±aD'Eyfun,,AEypA;AUEQ:ADTIxO?C@EQ?nI?0IAfEdECOd°Ey?p?01,
04-o-Ey0DEa3bHYES”,-nOd-p?00,0-?°-EyODEa3bHNOn\£?0IAEQO,E3SlAolp1(區(qū)中7
O?NupAxO-u'?i£
AyEQ,xQ?uz@LEVELEQ?0tA,^0xQ-u'?123312^12?Eq?0IA\£
X,6含:2「。6'3珀6,036配的]£
,ooo-ooo
Ceid4Ajrmain-EyIjEaEuEy0£)pAEiiAUEY,^b6u-EyfunpA?"A"A0DiiEeEu
土立£TpA它6,i£
EOia3iDd:
?include<stdio.h>
#defineN80
intfun(char*str)
(
)
main()
(
chars[N];
FILE*out;
char*test[]={”1234321“,“123421“,”123321”,“abcdCBA"};
inti;
printf("Enterastring:");
gets(s);
printf("\n\nH);
puts(s);
if(fun(s))
printf(HYES\nn);
else
printf(HN0\nn);
/★★★★★*****★★★*****★★★****★★★★****★★★/
out=fopen(nout.daf\HwH);
for(i=0;i<4;i++)
if(fun(test[i]))
fprintf(out,nYES\nn);
else
fprintf(out,nNO\nn);
fclose(out);
/************************************/
)
飛。
intfun(char*str)
inti,n=0,fg=l;
char*p=str;
while(*p)
{
n++;
P++;
)
for(i=0;i<n/2;i++)
if(str[i]==str[n-l-i]);
else
(
fg=0;
break;
)
returnfg;
)
o-z
Ce±a0?idEyfun(char*s)z;AUEC°NxO-u@ODpAAUEYAaedAi£
zzao-za
AyEQ,xQ.-Q(g)ODO-6DpAxO'U?iabcdefg<Oop^-OA,AEy06,@ODpAAUEYtgfeci
cbai£
2z33
x<:Oa:c-00iDd40dEQlAi£
-o_oo-oo-,o
Cei<3iATmainEyijEaEuEy0£)pAEiiAUEY,^b0UEyfunpA?"A'A0BiiEeEu
iaD^AEo.EOi^aj£
EOia3iDd:
#include<string.h>
#include<conio.h>
#include<stdio.h>
#defineN81
voidfun(char*s)
(
)
main()
(
chara[N];
FILE*out;
printf(nEnterastring:;
gets(a);
printf("Theoriginalstringis:H);
puts(a);
fun(a);
printf("\nn);
printf(HThestringaftermodified:H);
puts(a);
H
strcpy(az"HelloWorld!);
fun(a);
out=fopen("out?dat“,“w");
H
fprintf(out,%s"za);
fclose(out);
/★★★★★****★★★*****★★★★★★****★★*I
)
i%21j/3。,ij
voidfun(char*s)
(
charch;
int
i=0;
m=n=strlen(s)-1;
while(i<(n+l)/2)
(
ch=s[i];
s[i]=s[m];
s[m]=ch;
i++;
m——;
}
)
o-1zaa2
Ce±aD-d?ibEyfunrEiipA;AUEQ:^?d?,bEyxdxO-Q?x??ib?idOQEy(?pAp^
OACOiNOIa匕?x。?C'?xala0uEypAo-Ey)\£
zHnaa
AyEQzEdEaEexO-u?-1234z6d°~Ey°NEux??IOQEyOp-1234j£
2z33
x<:Oa:c-OdtDdA0d^QiAi£
-ooo-oo-,o
CeidiASImain-EyIjEaEuEy6DpAEtIAUEYz^b6uEyfunpA?"A'A0DIiEeEu
iaD^AEo.EOi^ajE
EOIa3if)d:
#include<stdio.h>
#include<string.h>
longfun(char*p)
(
)
voidmain()
(
FILE*wf;
chars[6];
longn;
printf("Enterastring:\n");
gets(s);
n=fun(s);
nH
printf(%ld\nrn);
/★★★★★★★★★★★★★***★*★**★*★★★****/
wf=fopen("out.dat","w");
fprintf(wf,fun(”-1234”));
fclose(wf);
/★★★★****★★★★*★*★*★★★*****★★★★I
}
i%2jjW,jt
longfun(char*p)
(
longn=0;
intflag=l;
if(*p==,-1)
{p++;flag=-1;}
elseif(*p==1+1)
P++;
while(*p!=*\01
{n=n*10+*p-101;
P++;
}
returnn*flag;
)
z
Qe±aD0?5b°-Eyvoidfun(char
1zaaaZZ
*ss)^a.|AUEC:^?xO-u@ssODEti6DiA±eI^Eyi?OAEipAxdAix??i6D(Ed,
22a
Ai?OAEi?E(;xOAi,0d?x??)j£
AyEQ,E6EaEeabc4EFg,Odd|Ea3baBc4EFgi£
2Z33
x<:0a:c-OdiDdi0bEQlAi£
ooo-oo-o
Cei5iASI-main-EyI^aEuEy0£)pAEtiAUEYz^b6uEyfunpA?"A"A0DiiEeEu
z
±a£)pAEo5EOi^aj£
EOIa3IDd:
#include<conio.h>
?include<stdio.h>
?include<string.h>
voidfun(char*ss)
)
voidmain()
chartt[51];
FILE*out;
printf("Pleaseenterancharacterstringwithin50characters:\nn);
gets(tt);
Hn
printf(\n\nAfterchanging,thestring\n%sztt);
fun(tt);
printf(n\nbecomes\n%sn,tt);
/★★★★****★★★★*★*★*★★★*****★★★**/
out=fopen(Hout.datH,nw");
strcpy(tt,"Afterchangingthestring**);
fun(tt);
Hn
fprintf(out,%sztt);
fclose(out);
/★★★★****★★★★****★★★★****★★★★★★/
)
飛。,比
voidfun(char*ss)
(
inti,n=0;
char*p=ss;
while(*p)
(
n++;
p++;
)
for(i=0;i<n;i++)
if((ss[i]>=,a,&&ss[i]<=,z,)&&i%2!=0)
ss[i]=ss[i]-32;
ss[i]=1\01;
)
,-o-33aZ3
±aDd?1d°Ey,,AEycEd0l^O?,dn^IEI2pAxQ-ui?OUAid*,oxQ-u?ODbiO
pAzIEy?£AyEQ,"EaEepAxO?uZ?Iaasdasasdfgasdaszx67asd
mklo,xQxQ-uz@Iaas,OdOIp±Ea3b6,£
x<:Oa:-OOZ3IDd,03dE?IAi£
CeI5,A3|-maino-EyoijEaEuo-EyC?pAEIoiAUEY,^60Uo-EyfunpA?"A"oA0BiiEeEu
±afi'pAEo,EOi^ai£
EOia3iDd:
?include<conio.h>
#include<stdio.h>
#include<string.h>
ttinclude<stdlib.h>
intfun(char*str,char*substr)
{
}
voidmain()
(
FILE*wf;
charstr[81],substr[3];
intn;
system(nCLSH);
printf(nEaEeO^xO-uz<§>:n);
gets(str);
printf("EaEex6xO-uz?:");
gets(substr);
puts(str);
puts(substr);
n=fun(str,substr);
,,n
printf(n=%d\nzn);
/★★★★****★★★★*★*★*★★★******★★★*/
wf=fopen("out.dat",HwH);
n=ftin(nasdasasdfgasdaszx67asdmklon,"asH);
HH
fprintf(wf,%dzn);
fclose(wf);
/*****************************/
)
intfun(char★str,char*substr)
(
intizj=0;
for(i=0;str[i+1]!=*\01;i++)
if(str[i]==substr[0]&&str[i+1]==substr[1])
j++;
returnj;
±aD'O?,do-Ey,z6z?EepAnum.bxO-u0D003bxi3npAO?,dxO-uz?,2<:t"1yDI2IO.O
zza
emax??0sA@p0O?(6A****xi^aE0EaEepA±eO^);£
x?Oa:2i-OO-3iDd.03dE<?IAi£
Qei3,A3I-main0-Ey0IffiaEu0-EyODpAEi0iAUEY,ilb6u0-EyfunpA?"A-0AdDiiEeEu
laD^pAEo.EOi^aiE
EOta3IDd:
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
char*fun(char(*a)[81],intnum,char*max)
(
)
voidmain()
(
FILE*wf;
charss[10][81],*ps=NULL;
chars[3][81]={”abcd“,“deg“,"diegns”},*p=NULL;
inti=0,n;
system(nCLSH);
printf(nEaEeE6,E,dxQ-uz?£on);
gets(ss[i]);
puts(ss[i]);
while(!strcmp(ss[i],H****")==0)/*6A4,dD(;oAx4-ia^aE0EaEepA±eO^*/
(
i++;
gets(ss[i]);
puts(ss[i]);
}
n=i;
ps=fun(ss,n,ps);
printf(”\nmax=%s\n",ps);
/**********★**************★★★**/
wf=fopen("out.dat",Hwn);
p=fun(s,3,p);
nn
fprintf(wf,%szp);
fclose(wf);
/**************************★**/
)
i%2曳力力。,工
char*fun(char(*a)[81],intnum,char*max)
(
inti=0;
max=a[0];
for(i=0;i<num;i++)
if(strlen(max)<strlen(a[i]))
max=a[i];
returnmax;
)
xo-121o-
±aDd?4dEyfun,EupA|AUEQ:EpIOA^,bxQ?u^@pAA-?^6(?E0AeaEystrcat
),,‘°Np2EuO,pAxQ-uz@A-i^6p^p1Eu0,pA^O?uz?06i£
z
AyE<;z?0±6EaEeiAA?A^4bx0-u?:
FirstString
SecondString
6d3IDdEa3d:
FirstStringSecondString
xeOa:2s^Dd^^EQlAjE
-ooo-oo-o
QeidiA^main-EyIjEaEuEy0£)pAEitAUEYz^b6uEyfunpA?"A"A0DiiEeEu
iaD^AEo.EOi^ait
EOia3IDd:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
voidfun(charpl[],charp2[])
(
)
voidmain()
(
FILE*wf;
charsi[80],s2[40];
charpl[80]=nFirstStringn,p2[40]=nSecondstringH;
system("CLSH);
printf(nEntersiands2:\nn);
scanf("%s%s",si,s2);
printf(nsl=%s\nn,si);
printf("s2=%s\n",s2);
printf("Invokefun(sl,s2):\n");
fun(si,s2);
printf("Afterinvoking:\n");
nn
printf(%s\nzsl);
I★★★
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年綠色能源開發(fā)與利用合同
- 2024酒店管理星級(jí)酒店物業(yè)管理合同
- 2024石材石材勞務(wù)派遣與職業(yè)培訓(xùn)合同2篇
- 2024年租賃物業(yè)延期協(xié)議3篇
- 2024年購(gòu)銷協(xié)議與購(gòu)貨合同的異同
- 2024年食材配送外包協(xié)議2篇
- 2024幼兒園教師藝術(shù)教育項(xiàng)目合作協(xié)議3篇
- 2024年度科技型企業(yè)核心團(tuán)隊(duì)股權(quán)限制性授予協(xié)議書3篇
- 2024年道路照明設(shè)備安裝及維護(hù)承包協(xié)議版B版
- 2024年網(wǎng)絡(luò)安全保障與合規(guī)檢查合同
- 2025湖北襄陽市12345政府熱線話務(wù)員招聘5人高頻重點(diǎn)提升(共500題)附帶答案詳解
- 血細(xì)胞分析報(bào)告規(guī)范化指南2020
- ISO 56001-2024《創(chuàng)新管理體系-要求》專業(yè)解讀與應(yīng)用實(shí)踐指導(dǎo)材料之7:“5領(lǐng)導(dǎo)作用-5.1領(lǐng)導(dǎo)作用和承諾”(雷澤佳編制-2025B0)
- 2024年快速消費(fèi)品物流配送合同6篇
- 廣東省茂名市2024屆高三上學(xué)期第一次綜合測(cè)試(一模)歷史 含解析
- 神經(jīng)重癥氣管切開患者氣道功能康復(fù)與管理學(xué)習(xí)與臨床應(yīng)用
- 第5章 一元一次方程大單元整體設(shè)計(jì) 北師大版(2024)數(shù)學(xué)七年級(jí)上冊(cè)教學(xué)課件
- 人教版高一地理必修一期末試卷
- 遼寧省錦州市(2024年-2025年小學(xué)六年級(jí)語文)部編版期末考試(上學(xué)期)試卷及答案
- 2024年下半年鄂州市城市發(fā)展投資控股集團(tuán)限公司社會(huì)招聘【27人】易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- GB/T 29498-2024木門窗通用技術(shù)要求
評(píng)論
0/150
提交評(píng)論