3、计算平均成绩并统计90分以上的人数。请填空#include “stdio.h”void main(){ int n,m ; float grade,average; n=m= ;{ (“%f”,&grade);if(grade<0) break;n++;average+=grade;if(grade<90) ;m++;}if(n) printf(“%.2f\n%d\n”,average/n,m); }
举一反三
- 功能:计算平均成绩并统计90分以上人数。#include <;stdio.h>;main(){int n,m;float grade,average;average=0.0;/***********SPACE***********/n=m=【1】;while(1){【?】("%f",&grade);if(grade<;0) break;n++;average+=grade;if(grade<;90)【3】;m++;}if(n) printf("%.2f%d\n",average/n,m);}
- 下列程序计算平均成绩并统计90分及以上人数。#include "stdio.h" main() {int n,m; float grade,average; average=n=m=; while() { scanf("%f",&grade); if(grade<0)break; n++; average+=grade; if(grade<90) ; m++; } if(n)printf("%.2f%d ",average/n,m); }
- 下列程序的功能是计算机平均成绩并统计90分以上的人数。 main ( ) { int n,m; float grade, average; average=n=m= 【13】 ; while( 【14】 ) { scanf("%f", &grade); if (grade<0) break; m++; average+=grade; if (grade<90) 【15】 ; m++; ) if(n) printf("%.2f %d\n",average/n,m); }
- #include main()_ { char grade=’C’; switch(grade) { case ‘A’: printf(“90-100\n”); case ‘B’: printf(“80-90\n”); case ‘C’: printf(“70-80\n”); case ‘D’: printf(“60-70\n”); break; case ‘E’: printf(“<60\n”); default : printf(“error!\n”); } } 运行结果为( )
- 程序填空,使下面程序实现输出N!(N<=10000)的最低三位。#include <stdio.h>int main(){int N,M=1;scanf("%d",&N);for (int i=1;i<=N;i++){M=M*i;M=__________;}printf("%03d",M);return 0;}?