赞
踩
- #include<stdio.h>
- int main()
- {
- int i,n,count=0;
- double grade,total=0;
- printf("输入班级人数:");
- scanf("%d",&n);
- for(i=1;i<=n;i++)
- {
- scanf("%lf",&grade);
- total=total+grade;
- if(grade<60)
- {
- count++;
- }
- }
- printf("平均分为%.2lf\n",total/n);
- printf("不及格有%d\n",count);
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。