Advertisement

UVA-12412, Typical Homework ( Shi Xiong Bang Bang Mang )

阅读量:

题目长度较长,但难度并不高,调试一个错误花费了较长时间,最终成功通过测试。在处理浮点数时需添加1e-5以避免误差;当数据库为空时应直接输出0.00(尽管udebug中显示为nan);此外,在执行操作4时所输出的单引号必须为英文格式,而示例中使用的是中文符号。

访问链接:UVA-12412

通过的代码:

复制代码
 #include<iostream>

    
 #include<map>
    
 #include<algorithm>
    
 #include<cstring>
    
 #include<vector>
    
 using namespace std;
    
 const double eps=1e-5;
    
 struct student{
    
 	int cla,pos,ma,en,ch,co,all,rank;//cla代表班级,ma表示数学,en表示英语,ch表示语文,co表示编程,all表示总分,rank表示排名,pos表示进入库的顺序
    
 	double ave;//均分
    
 	string name,num;//num表示编号
    
 };
    
 int all_cnt;
    
 map<string,s

全部评论 (0)

还没有任何评论哟~