标题:向各位请教!此程序到底哪里错了??
取消只看楼主
我为C痴
Rank: 1
等 级:新手上路
帖 子:23
专家分:0
注 册:2007-8-31
 问题点数:0 回复次数:1 
向各位请教!此程序到底哪里错了??
//程序:AVERAGE.CPP
//功能:求数、理、化三科平均成绩的总评,演示if语句嵌套的缩进形式。
#include<iostream.h>
void main()
{
int math,phys,chem;
int average;
float scholarship;
cout<<"Enter scores of math.,phys.and chem.:";
cin>>math>>phys>>chem;
average=(math+phys+chem)/3.0+0.5;
if(average>=90){
cout<<"Excellt.\n";
scholarship=120.00;
}else if(average>=80){
cout<<"Good.\n";
scholarship=85.00;
}else if(average>=70){
cout<<"Average.\n";
scholarship=55.00;
}else if(average>=60){
cout<<"Pass.\n";
scholarship=45.50;
}else{
cout<<"Fail.\n";
scholarship=0.00;
}
cout<<"Your scholarship is"<<sholarship<<".\n";
}
这个程序哪里出错啦。。。不能编译出来 找了好久没发现啊
搜索更多相关主题的帖子: average include scores Enter 
2007-10-10 19:22
我为C痴
Rank: 1
等 级:新手上路
帖 子:23
专家分:0
注 册:2007-8-31
得分:0 
好像不是楼上两位大哥说的那样啊!!!
2007-10-14 18:56



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-176504-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.112092 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved