版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1-5
floata[10];
#include<stdio.h>inti;
intmain()floatmax;
(for(i=0;i<10;i++)
printf(u*************************'n\n").(
printf("VeryGood!\n\n");scanf("%f",&a[i]);
printf(“*************************\n”).)
return0;max=a[0];
}for(i=l;i<10;i++)
1-6(
if(max<a[i])
#include<stdio.h>(
intmain()max=a[i];
()
intazb,c,max;)
printf("pleaseinputa,b,c:\n");printf("max=%.lf\n",max);
scanf("%d,%d,%d",&a,&b,&c);return0;
max=a;)
if(max<b)
243
max=b;
if(max<c)/include<stdio.h>
max=c;intmain()
printf(HThelargestnumber{
is%d\n",max);floata,b,c,t;
return0;scanf(,,%f,%f,%f",&a,&b,&c);
)if(a>b)
2-4.1(
t=a;
include<stdio.h>a=b;
#include<string.h>b=t;
intmain()}
(if(a>c)
chara[5]="醬油,b[5]="醋,c[5];(
strcpy(cza);t=a;
strcpy(a,b);a=c;
strcpy(b,c);c=t;
,,
printf("a=%s,b=%s\n,a,b);)
return0;if(b>c)
)(
t=b;
2-4.2
b=c;
#include<stdio.h>c=t;
intmain())
printf(“%5.2f,%5.2f,%5.2f\n“,a,b,c);r0=0.0072;
return0;pl=p*((l+r5)*5);
}p2=p*(l+2*r2)*(l+3*r3);
p3=p*(l+3*r3)*(l+2*r2);
p4=p*pow(l+rl,5);
include<stdio.h>p5=p*pow(l+r0/4,4*5);
intmain()printf("pl=%f\n",pl);
(printf("p2=%f\n",p2);
inti,t;printf("p3=%f\n",p3);
t=l;printf("p4=%f\n",p4);
i=2;printf("p5=%f\n",p5);
while(i<=100)return0;
()
t=t+i;
3-3
i=i+l;
)#include<stdio.h>
printf("%d\n”,t);#include<math.h>
return0;intmain()
floatd=300000,p=6000,r=0.01,m;
m=loglO(p/(p-d*r))/loglO(l+r);
#include<stdio.h>printf("m=%6.1f\n"/m);
#include<math.h>return0;
intmain())
(
3-5
floatpjn;
r=0.1;#include<stdio.h>
n=10;intmain()
p=pow(l+cn);{
printf("p=%f\n"/p);inta,b;
return0;floatx,y;
}charcl,c2;
scanf(Ha=%db=%d",&a,&b);
scanf("%f%e",&x,&y);
#include<stdio.h>scanf("%c%c",&cl,&c2);
#include<math.h>printf("a=%d/b=%dzx=%f,y=%f,cl=%c,c2
intmain()%c\n",a,b,x,y,cl,c2);
(return0;
floatr5,r3,r2jl,r0,p,pl,p2,p3,p4,p5;)
p=1000;
r5=0.0585;
「3=0.054;
r2=0.0468;
rl=0.0414;
chargrade;
3-6
printf("請輸入學(xué)生成績
#include<stdio.h>scanf(“%f”,&score);
intmain()while(score>10011score<0)
((
,,,,,,,,
charcl=C'/c2=h/c3='i/c4=n,c5=a;printf("\n輸入有誤,請重輸)
cl=cl+4;scanf("%f”,&score);
c2=c2+4;)
c3=c3+4;switch((int)(score/10))
c4=c4+4;(
c5=c5+4;case10:
printf("passwordcase9:grade='A';break;
,,
is%c%c%c%c%c\n/cl/c2,c3,c4,c5);case8:grade='B';break;
return0;case7:grade='C';break;
)case6:grade='D';break;
case5:
3-7
case4:
#include<stdio.h>case3:
intmain()case2:
(case1:
floathjl,s,sq,vq,vz;case0:grade='E,;
floatpi=3.141526;)
(”請輸入圓半徑圓柱高成績是相應(yīng)的等級
printfr,h:“);printf("%5.1fz
,,,
scanf(%t%f'/&r,&h);是%(:\|1",score,grade);
l=2*pj*r;return0;
s=r*r*pi;)
sq=4*pi*r*r;
4-9
vq=3.0/4.0*pi*r*r*r;
vz=pi*r*r*h;#include<stdio.h>
printf(“圓周長為:l=%6.2f\n”,l);#include<math.h>
printf("圓面積為:s=%6.2f\n",s);intmain()
printfC圓球表面積為:{
sq=%6.2f\nH,sq);int
printf("圓球體積為:numjndi^ten,hundred,thousandzten_thousan
vq=%6.2f\n",vq);d,place;
printf("圓柱體積為:printf("請輸入一個整數(shù)(0-99999):");
vz=%6.2f\nH,vz);scanf("%d”,&num);
return0;if(num>9999)
place=5;
4-8
elseif(num>999)
#include<stdio.h>place=4;
intmain()elseif(num>99)
{place=3;
floatscore;elseif(num>9)
',
place=2;casel:printf(%d"/indiv);
elseplace=l;printf("\n反序數(shù)字為
位數(shù):,
printf(“%d\n",place);printf("%d\n'/indiv);
printf("每位數(shù)字為break;
ten_thousand=num/10000;)
return0;
thousand=(int)(num-ten_thousand*10000)/1)
000;
4-10
hundred=(int)(num-ten_thousand*10000-thoinclude<stdio.h>
usand*1000)/100;intmain()
|
ten=(int)(num-ten_thousand*10000-thousaninti;
d*1000-hundred*100)/10;double
bonus,bonl,bon2zbon4,bon6,bonl0;
indiv=(int)(num-ten_thousand*10000-thousaintbranch;
nd*1000-hundred*100-ten*10);bonl=100000*0.1;
switch(place)bon2=bonl+100000*0.075;
{casebon4=bon2+100000*0.05;
5:printf(”%d,%d,%d,%d,%cT,ten_thousand,thbon6=bon4+100000*0.03;
ousand,hundred,tenJndiv);bonl0=bon6+400000*0.015;
printf("\n反序數(shù)字為:");printf(“請輸入利潤i:");
scanf("%d",&i);
,,
printf(%d%d%d%d%d\n"Jndiv/ten,hundred,1branch=i/100000;
housand,ten_thousand);if(branch>10)branch=10;
break;switch(branch)
case(
4:printf("%d,%d,%d,%cT,thousand,hundred,tecase0:bonus=i*0.1;break;
njndiv);case1
printf("\n反序數(shù)字為:");bonus=bonl+(i-100000)*0.075;break;
case2:
printf("%d%d%d%d\n",indiv/ten,hundred/thocase3
usand);bonus=bon2+(i-200000)*0.05;break;
break;case4:
casecase5
3:printf("%d,%d,%cT,hundred,ten,indiv);bonus=bon4+(i-400000)*0.03;break;
printf("\n反序數(shù)字為:");case6:
case7:
printf("%d%d%d\n",indiv,ten,hundred);case8:
break;case9
case2:printf("%d,%d”,ten,indiv);bonus=bon6+(i-600000)*0.015;break;
printf("\n反序數(shù)字為:");case10
printf("%d%d\n",indiv,ten);bonus=bonl0+(i-1000000)*0.01;break;
break;)
printf("獎金是:%10.2f\n",bonus);{t=a;a=b;b=t;}
return0;if(a>c)
}{t=a;a=c;c=t;}
if(a>d)
4-10
{t=a;a=d;d=t;}
include<stdio.h>if(b>c)
intmain(){t=b;b=c;c=t;}
(if(b>d)
inti;{t=b;b=d;d=t;}
doubleif(c>d)
bonus,bonl,bon2,bon4,bon6,bonl0;{t=c;c=d;d=t;}
bonl=100000*0.1;printf("排序結(jié)果如下:\n下
bon2=bonl+100000*0.075;printf("%d%d%d%d\n”,a,b,c,d);
bon4=bon2+100000*0.05;return0;
bon6=bon4+100000*0.03;}
bonl0=bon6+400000*0.015;
4-12
printf("請輸入利潤i:");
scanf("%d",&i);#include<stdio.h>
if(i<=100000)intmain()
bonus=i*0.1;{
elseif(i<=200000)inth=10;
bonus=bonl+(i-100000)*0.075;float
elseif(i<=400000)xl=2,yl=2zx2=-2zy2=2/x3=-2zy3=-2,x4=2/y4=-2
bonus=bon2+(i-200000)*0.05;,x,y,dl,d2,d3,d4;
elseif(i<=600000)printf(“請輸入一個點(x,y):");
bonus=bon4+(i-400000)*0.03;scanf("%f,%f",&x,&y);
elseif(i<=1000000)dl=(x-x4)*(x-x4)+(y-y4)*(y-y4);
bonus=bon6+(i-600000)*0.015;d2=(x-xl)*(x-xl)+(y-yl)*(y-yl);
elsed3=(x-x2)*(x-x2)+(y-y2)*(y-y2);
bonus=bonl0+(i-1000000)*0.01;d4=(x-x3)*(x-x3)+(y-y3)*(y-y3);
printf("獎金是:%10.2f\n”,bonus);if(dl>l&&d2>l&&d3>l&&d4>l)
return0;h=0;
)printf(“該點高度為%d\n",h);
return0;
4-11
)
#include<stdio.h>
5-2
intmain()
(/include<stdio.h>
intt,a,b,c,d;#include<math.h>
printf("請輸入四個數(shù):");intmain()
scanf("%d,%d,%d,%cT,&a,&b,&c,&d);{
printf("a=%d,b=%d,c=%d,d=%d\n",a,b,c/intsign=l,count=0;
d);doublepi=0.0,n=1.0/term=1.0;
if(a>b)while(fabs(term)>=le-6)
n=m;
pi=pi+term;m=temp;
n=n+2;)
sign=-sign;p=n*m;
term=sign/n;while(m!=0)
count++;(
)r=n%m;
pi=pi*4;n=m;
printf("pi=%10.8f\n"/pi);m=r;
printf("count=%d\n",count);)
return0;printf(“它們的最大公約數(shù)為:%d\n“,n);
)printf("它們的最小公約數(shù)
為:%d\n,p/n);
5-2
return0;
#include<stdio.h>}
include<math.h>
5-4
intmain()
(/include<stdio.h>
intsign=l,count=0;intmain()
doublepi=0.0,n=1.0,term=1.0;{
while(fabs(term)>=le-8)charc;
(intletters=0,space=0,digit=0,other=0;
pi=pi+term;printf(“請輸入一行字符:\n“);
n=n+2;while((c=getchar())!='\n')
sign=-sign;(
term=sign/n;if(c>='a'&&c<='z'||
count++;c>='A'&&c<二Z)
)letters++;
pi=pi*4;elseif(c==*')
printf("pi=%10.8f\n",pi);space++;
,,
printf("count=%d\n/count);elseif(c>='0'&&c<='9')
return0;digit++;
)else
other++;
5-3
)
include<stdio.h>printf("字母:%d\n空格數(shù):%d\n數(shù)字
intmain()數(shù):%d\n其他字符
(數(shù):%d\rT,letters,space,digit,other);
intp,.n,m,temp;return0;
prints請輸入兩個正整數(shù)n,m:");}
scanf(”%d,%d,",&n,&m);
if(n<m);
temp=n;
for(k=l;k<=n3;k++)
5-5
{s3=s3+l/k;}
#include<stdio.h>printf("sum=%15.6f\n"zsl+s2+s3);
intmain()return0;
()
inta,nJ=l,sn=Otn=O;
z5-8
printf("a,n=:");
scanf(”%d,%cT,&a,&n);#include<stdio.h>
while(i<=n)intmain()
({
tn=tn+a;inti,j,k,n;
sn=sn+tn;printf("parcissusnumbersare");
a=a*10;for(n=100;n<1000;n++)
++i;(
)i=n/100;
printf("a+aa+aaa+...=%d\n",sn);j=n/10-i*10;
return0;k=n%10;
)if(n==i*i*i+j*j*j+k*k*k)
printf("%d”,n);
5-6
)
#include<stdio.h>printf("\n");
intmain()return0;
()
doubles=O,t=l;
5-9
intn;
for(n=l;n<=20;n++)include<stdio.h>
(intmain()
t=t*n;{
s=s+t;intm,s,i;
)for(m=2;m<1000;m++)
printf("l!+2!+...+20!=%22.15e\n",s);(
return0;s=0;
)for(i=l;i<m;i++)
if((m%i)==0)s=s+i;
5-7
if(s==m)
include<stdio.h>{printf("%d,itsfactorsare,m);
intmain()for(i=l;i<m;i++)
(if(m%i==0)printf("%d"J);
int01=100,02=50,n3=10;printf("\n");
doublek,sl=0,s2=0,s3=0;}
for(k=l;k<=nl;k++))
{sl=sl+k;}return0;
for(k=l;k<=n2;k++))
{s2=s2+k*k;}
xl=(x2+l)*2;
5-10
x2=xl;
#include<stdio.h>day-;
intmain()
(printf("total=%d\n",xl);
inti,n=20;return0;
doublea=2,b=l/s=0/t;)
for(i=l;i<=n;i++)
5-16
(
s=s+a/b;include<stdio.h>
t=a,intmain()
a=a+b,|
b=t;intijk;
)for(i=0;i<=3;i++)
printf("sum=%16.10f\n"/s);{for(j=0;j<=2-i;j++)
return0;printf("");
)for(k=0;k<=2*i;k++)
printf("*");
5-11
printf("\n");
include<stdio.h>)
intmain()for(i=0;i<=2;i++)
({
doublesn=100,hn=sn/2;for(j=0;j<=i;j++)
intn;printf("");
for(n=2;n<=10;n++)for(k=0;k<=4-2*i;k++)
(printf("*");
sn=sn+2*hn;printf("\n");
hn=hn/2;}
)return0;
printf("第10次落地時共經(jīng)過%£米}
\n",sn);
5-17
printf("第10次反彈時%f米\n",hn);
return0;#include<stdio.h>
)intmain()
(
5-12
chari,j,k;
#include<stdio.h>for(i='x';i<=,z';i+4-)
intmain()for(j='x';j<='z';j++)
(if(i!=j)
intday,xl,x2;for(k='x';k<='z,;k++)
day=9;if(i!=k&&j!=k)
x2=l;if(i!='x'&&k!='x'&&kl='z')
while(day>0)printf("A-%c\nB-%c\nC-%c\n"J/j/k),
return0;
inti=0,j=0,a[3][3],sl,s2;
6-1
for(i=0;i<3;i++)
#include<stdio.h>for(j=0;j<3;j++)
intmain()scanf("%d",&a[i][j]);
(sl=a[0][0]+a[l][l]+a[2][2];
inti,j,a[100];s2=a[0][2]+a[l][l]+a[2][0];
for(i=2;i<100;i++)printf("sl=%d,s2=%d\n",sl,s2);
(return0;
a[i]=i;)
for(j=2;j<=i;j++)
6-4
(
if(j<i)#include<stdio.h>
if(a[i]%j==O)intmain()
break;(
if(a[i]-j==O)staticint
printf("%5d",a[i]);a口0]={l,7,8,17,23,24,59,62,101};
)inti,t;
)scanf("%d",&a[9]);
printf("\n");for(i=9;i>0;i-)
return0;if(a[i]<a[i-l])
)(
t=a[i-l];a[i-l]=a[i];a[i]=t;
6-2
)
#include<stdio.h>for(i=0;i<10;i++)
intmain()printf("%5d",a[i]);
(printf("\n");
inti,j,a[10],t;return0;
for(i=0;i<10;i++))
scanf("%d",&a[i]);
6-5
for(j=l;j<10;j++)
for(i=0;i<=9-j;i++)#include<stdio.h>
if(a[i]>a[i+l])intmain()
({
t=a[i+l];a[i+l]=a[i];a[i]=t;int1,6(10];
)for(i=0;i<10;i++)
for(i=0;i<10;i++)scanf("%d"z&b[i]);
printf("%5d\n",a[i]);for(i=9;i>-l;i-)
return0;printf("%5d"zb[i]);
)printf("\n");
return0;
6-3
}
#include<stdio.h>
intmain()
6-6
)
#include<stdio.h>else
intmain()(
(if(i<l)i=n;
staticintmzn,k,b[15][15];if(j>n)j=l;
b[O][l]=l;}
for(m=l;m<15;m++)if(a[i][j]==0)
(a[i][j]=k;
for(n=l;n<=m;n++)else
(
i=i+2;
b[m][n]=b[m-l][n-l]+b[m-l][n];
printf(“%?5d,b[m][n]);a[i][j]=k;
)}
printf("\n");)
)for(i=l;i<=n;i++)
return0;(
}for(j=l;j<=n;j++)
printf("%4d",a[i][j]);
6-7
printf("\n");
#include<stdio.h>)
intmain()return0;
()
inta[16][16],i,j,k,p,n;
6-8
P=l;
while(p==l)#include<stdio.h>
(intmain()
printf("Entern(n=l~15):");(
scanf("%d",&n);inta⑸⑸,b⑸,c⑸,d⑸⑸,k=0,l=0;
if((n!=0)&&(n<=15)&&(n%2!=0))inti,j;
P=0;for(i=0;i<5;i++)
)for(j=0;j<5;j++)
for(i=l;i<=n;i++)scanf("%d",&d[i][j]);
for(j=l;j<=n;j++)a[i][j]=0;for(i=0;i<5;i++)
j=n/2+l;for(j=0;j<5;j++,a[i][j]=d[i][j]);
a⑴for(i=0,k=0;i<5;i++,k++)
for(k=2;k<=n
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024-2030年撰寫:中國吸附塔項目風(fēng)險評估報告
- 2024-2030年互感器搬遷改造項目可行性研究報告
- 2024-2030年中國食品生物技術(shù)市場競爭格局展望及投資策略分析報告
- 2024年滬科新版九年級歷史上冊階段測試試卷含答案280
- 2024年上外版八年級歷史上冊月考試卷含答案953
- 2024年木材雕刻藝術(shù)品制作木工合同范本3篇
- 機織物課程設(shè)計報告
- 插值算法課課程設(shè)計
- 2022-2023年浙江省杭州市余杭區(qū)六年級下冊期中語文試卷及答案
- 燃?xì)庹n程設(shè)計紙
- 施工員崗位述職報告
- 第47屆江蘇省選拔賽化學(xué)實驗室技術(shù)項目技術(shù)文件
- 肺部感染性疾病支氣管肺泡灌洗病原體檢測中國專家共識(2017年)
- 第六單元《多邊形的面積》 單元測試(含答案)2024-2025學(xué)年人教版五年級數(shù)學(xué)上冊
- 小學(xué)勞動教育實施情況調(diào)查問卷(含教師卷和學(xué)生卷)及調(diào)查結(jié)論
- 【部編】人教版六年級上冊道德與法治全冊知識點總結(jié)梳理
- 食品公司安全生產(chǎn)管理制度
- 智慧物流第2套理論題附有答案
- 網(wǎng)絡(luò)設(shè)備駐場運維服務(wù)方案
- 2024-2030年中國功效性護膚品市場需求量調(diào)研及發(fā)展態(tài)勢分析研究報告
- 創(chuàng)業(yè)基礎(chǔ)知識題庫100道及答案
評論
0/150
提交評論