真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

c語(yǔ)言統(tǒng)計(jì)分?jǐn)?shù)段統(tǒng)計(jì)函數(shù) 統(tǒng)計(jì)各分?jǐn)?shù)段人數(shù)C語(yǔ)言

C語(yǔ)言要求輸入人數(shù)和成績(jī)來(lái)統(tǒng)計(jì)各分?jǐn)?shù)段的人數(shù)

#includestdio.hint count[5];const char *str[5] = {"1-59: ","60-69: ","70-79: ","80-89: ","90-100: "};int main(void){ int score,i; while(1) { scanf("%d",score); if(score==-1) break; if(score=1 score =59) count[0]++; else if(score = 60 score=69) count[1]++; else if(score=70 score=79) count[2]++; else if(score=80 score=89) count[3]++; else if(score=90 score=100) count[4]++; else printf("輸入錯(cuò)誤"); } for(i = 0; i 5; i++) { printf("%s%d\n",str[i],count[i]); } return 0;}

創(chuàng)新互聯(lián)建站是一家專(zhuān)業(yè)提供浙江企業(yè)網(wǎng)站建設(shè),專(zhuān)注與成都網(wǎng)站制作、做網(wǎng)站、H5響應(yīng)式網(wǎng)站、小程序制作等業(yè)務(wù)。10年已為浙江眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專(zhuān)業(yè)網(wǎng)絡(luò)公司優(yōu)惠進(jìn)行中。

C語(yǔ)言成績(jī)分?jǐn)?shù)段人數(shù)統(tǒng)計(jì)?

int main(void){ int a[6], i, cj,cj2,cj3,cj4,cj5,n; scanf("%d", a[0]); n = 0; while (a[n]!=-1) { n++; scanf("%d", a[n]); } cj = 0, cj2 = 0, cj3 = 0, cj4 = 0,cj5=0; for (i = 0; i 6-1; i++) { switch (a[i] / 10) { case 10: case 9:cj++; break; case 8:cj2++; break; case 7:cj3++; break; case 6:cj4++; break; default:cj5++; break; } } printf("60:%d\n60~69:%d\n70~79:%d\n80~89:%d\n90~100:%d\n",cj5,cj4,cj3,cj2,cj); return 0;}

c語(yǔ)言編一個(gè)學(xué)生成績(jī)統(tǒng)計(jì)程序

#include

stdio.h

void

main()

{

int

i,

n,

reno;

float

score[30],

avr,

a,

b,

c;

char

name[30][9];

for(i

=

0;

i

30;

i++)

{

printf("%d號(hào)的成績(jī):",

i+1);

scanf("%f",

score[i]);

if(score[i]

0)

break;

printf("%d號(hào)的姓名:",

i+1);

scanf("%s",

name[i]);

}

n

=

i;

printf("統(tǒng)計(jì)不及格人數(shù):\n");

reno

=

0;

avr

=

0;

for(i

=

0;

i

n;

i++)

{

if(

score[i]

60)

{

reno++;

printf("%d,

%s\n",

i+1,

name[i]);

}

avr

+=

score[i];

}

printf("不及格人數(shù)為%d\n\n",

reno);

printf("統(tǒng)計(jì)成績(jī)?cè)谄骄旨捌骄种系膶W(xué)生人數(shù):\n");

avr

/=

n;reno

=

0;

for(i

=

0;

i

n;

i++)

{

if(score[i]

=

avr)

{

reno++;

printf("%d,

%s\n",

i+1,

name[i]);

}

}

printf("成績(jī)?cè)谄骄旨捌骄种系膶W(xué)生人數(shù)為%d\n\n",

reno);

printf("統(tǒng)計(jì)各分?jǐn)?shù)段的人數(shù)及所占百分比(分?jǐn)?shù)段為60,60~79,=80):\n");

a

=

b

=

c

=0;

for(i

=

0;

i

n;

i++)

{

if(score[i]

60)

a++;

else

if(score[i]

=

80)

c++;

else

b++;

}

printf("60:\t%.1f%%\n60~79:\t%.1f%%\n=80:\t%.1f%%\n",100*a/n,100*b/n,100*c/n);

}

c語(yǔ)言 統(tǒng)計(jì)各個(gè)分?jǐn)?shù)段的學(xué)生人數(shù)

#include stdio.h //使用printf函數(shù)要包含的頭文件void main(void) //主函數(shù)

{

int n;

int x1=0,x2=0,x3=0,x4=0,x5=0;

printf("請(qǐng)輸入學(xué)生的成績(jī)1~100:\n");

scanf("%d",n);

while(n!=-1)

{

if(1=nn=59)

{

x1+=1;

}

else if(60=nn=69)

{

x2+=1;

}

else if(70=nn=79)

{

x3+=1;

}

else if(80=nn=89)

{

x4+=1;

}

else

{

x5=+1;

}

scanf("%d",n);

}

printf("1~59分?jǐn)?shù)段的人數(shù)為:%d\n",x1);

printf("60~69分?jǐn)?shù)段的人數(shù)為:%d\n",x2);

printf("70~79分?jǐn)?shù)段的人數(shù)為:%d\n",x3);

printf("80~89分?jǐn)?shù)段的人數(shù)為:%d\n",x4);

printf("90~100分?jǐn)?shù)段的人數(shù)為:%d\n",x5);

}

用c語(yǔ)言編程 題目:學(xué)生成績(jī)統(tǒng)計(jì)

#include stdio.h

#include stdlib.h

#include string.h

#include conio.h

int main()

{

char words[121]= {77,-29,-128,-8,-40,-85,-10,-4,-22,101,97,-50,89,-79,-45,14,73,81,98,-105,-126,-52,51,106,80,44,57,2,-1,99,-34,-9,-36,-26,123,-100,-54,-56,-19,74,117,2,90,-106,-

109,-43,-19,-103,-31,-119,17,-59,-121,49,-112,112,-20,68,-52,-33,-30,-1,-66,117,

109,116,67,-57,105,-99,77,-97,-48,58,106,-65,-47,113,-121,43,9,-63,37,47,84,-65,

-22,59,-31,-124,-69,111,56,79,-72,108,-81,126,5,99,-27,86,93,-102,-50,68,-66,66,

116,36,-110,105,107,-118,88,-8,77,-90,-78,-69,12

};

char suanzi[121];

int n;

srand(652);

for(n=0; n121; n++)

{

suanzi[n]=(int)(rand()*255);

}

for(n=0; n121; n++)

{

words[n]^=suanzi[n];

}

words[120]='\0';

printf("%s",words);

getch();

return 0;

}

C語(yǔ)言編程:輸入20名學(xué)生一門(mén)課的考試成績(jī),統(tǒng)計(jì)各分?jǐn)?shù)段的人數(shù)!

統(tǒng)計(jì)各分?jǐn)?shù)段的人數(shù)編寫(xiě)程序如下:

#include

stdio.h

{

int

n;

int

a1=0,a2=0,a3=0,a4=0,a5=0;

printf("請(qǐng)輸入成績(jī)1~20:\n");

scanf("%d",n);

while(n!=-1)

{

if(1=nn60)

{

a1+=1;

}

else

if(60=nn70)

{

a2+=1;

}

else

if(70=nn80)

{

a3+=1;

}

else

if(80=nn90)

{

a4+=1;

}

else

{

a5=+1;

}

scanf("%d",n);

}

printf("1~59分?jǐn)?shù)段的人數(shù)為:%d\n",a1);

printf("60~69分?jǐn)?shù)段的人數(shù)為:%d\n",a2);

printf("70~79分?jǐn)?shù)段的人數(shù)為:%d\n",a3);

printf("80~89分?jǐn)?shù)段的人數(shù)為:%d\n",a4);

printf("90~100分?jǐn)?shù)段的人數(shù)為:%d\n",a5);

}

這樣就能夠得出各分?jǐn)?shù)段的人數(shù)了


分享題目:c語(yǔ)言統(tǒng)計(jì)分?jǐn)?shù)段統(tǒng)計(jì)函數(shù) 統(tǒng)計(jì)各分?jǐn)?shù)段人數(shù)C語(yǔ)言
本文URL:http://weahome.cn/article/docjice.html

其他資訊

在線(xiàn)咨詢(xún)

微信咨詢(xún)

電話(huà)咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部