| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 652 人关注过本帖
标题:向各位请教!此程序到底哪里错了??
取消只看楼主 加入收藏
我为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
快速回复:向各位请教!此程序到底哪里错了??
数据加载中...
 
   



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

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