输入数的个数
输入n个100分制成绩(用整型),计算并输出平均成绩?
请问如何编写?
n如何记?
输入n个100分制成绩(用整型),计算并输出平均成绩?
请问如何编写?
n如何记?
2004-07-31 23:29
在c 语言中怎么无法运行?
2004-08-01 00:50
#include "stdio.h"
系统不是默认的吗?
getch();
}/*输入非数字退出循环*/
可否不用?
无法运行不知错误在那里呢?
2004-08-01 01:01
ok!谢谢
2004-08-01 19:07
#include "stdio.h"
main() { int n=0,f; float s=0;
while(scanf("%d",&f)!=NULL) { n++; s+=f; } printf("%.2f",s/n); getch();
ok?
2004-08-01 23:51
#include "stdio.h"
main() { int n=0,f; float s=0;
while(scanf("%d",&f)!=NULL) { n++; s+=f; } printf("%.2f",s/n); getch();
2004-08-01 23:56