早教吧作业答案频道 -->其他-->
帮忙看个程序:需要输入一个班全体学生的成绩,把不及格的学生成绩输出,并求及格学生的平均成绩.#includevoidmain(){intn;doublescore,sum=0,average;for(n=0;n=60){sum=sum+score;n++;}elseif(score=0)printf("%3d\n"
题目详情
帮忙看个程序:需要输入一个班全体学生的成绩,把不及格的学生成绩输出,并求及格学生的平均成绩.
#include
void main()
{
int n;
double score,sum=0,average;
for(n=0;n=60)
{ sum=sum+score;n++;}
else if(score=0) printf("%3d\n",score);
else if(score
#include
void main()
{
int n;
double score,sum=0,average;
for(n=0;n=60)
{ sum=sum+score;n++;}
else if(score=0) printf("%3d\n",score);
else if(score
▼优质解答
答案和解析
你定义的是double的变量,使用的时候全部是%d
对应的变量使用的地方换成%lf
double是双精度浮点数,要用%lf来输入输出
int %d
float %f
double %lf
#include
void main(){
int n;
double score,sum=0,average;
for(n=0;n=60) {
sum=sum+score;
n++;
} else if(score=0)
printf("%3lf\n",score);
else if(score
对应的变量使用的地方换成%lf
double是双精度浮点数,要用%lf来输入输出
int %d
float %f
double %lf
#include
void main(){
int n;
double score,sum=0,average;
for(n=0;n=60) {
sum=sum+score;
n++;
} else if(score=0)
printf("%3lf\n",score);
else if(score
看了 帮忙看个程序:需要输入一个班...的网友还看了以下:
画平面直角坐标系并求出面积1A(-6,0)B(0,8)C(0,3)求S△ABC2A(6,0)B(0 2020-06-07 …
设f'(x)=arctan[(x-1)^2],f(0)=0,求∫(0,1)f(x)dx,其中0是下 2020-07-22 …
#includemain(){char*p[]={"BOOL","OPK","H","SP"};i 2020-07-23 …
1.以下程序的输出结果是什么.#includevoidmain(){inta=1,b=0;swit 2020-07-23 …
求教求闰年为什么写成这样求不出if(n%4==0&&n%100!=0&&n%400==0)写成这样 2020-07-24 …
关于C语言,在线等。请写出输出能满足下列要求的printf语句,并给出适当解释。a.输出整型变量i 2020-07-25 …
在线等setfont(30,0,"宋体");printf("cannotopenfile\n");i 2020-11-01 …
小弟编个程序,算总价,但不知道为什么每次算出来结果都为零.我的本意time500)price=0.1 2020-12-06 …
一道二级C题目设有以下程序段:intx=0,s=0;while(!=0)s+=++x;printf( 2020-12-07 …
①已知/a/=4,/b/=3且a>b的值②已知/a+b/=0,/a-1/2/=0求a-b的值?什么答 2021-01-13 …