下列程序计算平均成绩并统计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分以上人数。#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分以上的人数。 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); }
- 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); }
- 中国大学MOOC: 下面程序的功能是计算两个整数的( )。#include <stdio.h>int main(){ int m,n,w; scanf("%d,%d",&m,&n); while (n) { w=m; m=n; n=w%n;} printf("%d",m); return 0;}
- #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”); } } 运行结果为( )