7_7.cpp
来自「C程序参考,简单易懂,是初学者不可少的参考资料」· C++ 代码 · 共 17 行
CPP
17 行
#include<stdio.h>
main()
{
int i,num;
float score[30],sum=0.0,ave;
printf("Please input number of students:");
scanf("%d",&num);
for(i=0;i<num;i++)
{
printf("Input score:");
scanf("%f",&score[i]);
sum+=score[i];
}
ave=(float)sum/(float)num;
printf("The average score of the students is:%6.2f\n",ave);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?