int main()
{
int score[10]
for(int i=0i<10i++)
scanf("%d",&score[i])
int pass=0,excellent=0
for(i=0i<10i++)
{
if(score[i]>=60)
pass++
if(score[i]>=80)
excellent++
}
printf("及格率是举兄拦%g%%\n",pass/10.0*100)
printf("优秀率是%g%%\n"尘仿,excellent/正胡10.0*100)
printf("\n不及格的分数为")
for(i=0i<10i++)
if(score[i]<60)
printf("%3d",score[i])
printf("\n")
}
#include <stdio.h>int main(int argc,char *argv[]){
int grade[33]
int count=0
int sum=0, i=0
printf("请输入33名学生的成绩:\n")
for(i<33i++){
scanf("%d",&grade[i])
if(grade[i]>=60)count++
sum=sum+grade[i]
}
printf("及格人脊渣数:族瞎%d\n",count)
printf("及格率:%d%% \n",100*count/33)
printf("班级平均分樱穗悄:%d\n",sum/33)
return 1
}
程序简单,自己不懂得网上查查,就不注释了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)