博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1062 Talent and Virtue (25)
阅读量:4320 次
发布时间:2019-06-06

本文共 1898 字,大约阅读时间需要 6 分钟。

1 /*  2   3   4 L (>=60), the lower bound of the qualified grades --   5 that is, only the ones whose grades of talent and virtue are both not below  6 this line will be ranked;   7   8 and H (<100), the higher line of qualification  9  10  11 ,those with both grades not below this line are considered as the "sages", 12 and will be ranked in non-increasing order according to their total grades.  13  14 Those with talent grades below H but virtue grades not are cosidered as  15 the "noblemen", and are also ranked in non-increasing order according to  16 their total grades, but they are listed after the "sages".  17  18  19 Those with both grades below H,  20 but with virtue not lower than talent are considered as the "fool men". 21 They are ranked in the same way but after the "noblemen".  22  23  24 The rest of people whose grades both pass the L line are ranked  25 after the "fool men". 26  27  28  29 */ 30  31 #include 
32 #include
33 #include
34 #include
35 using namespace std; 36 37 struct peo 38 { 39 char num[9]; 40 int all,t,v; 41 int id; 42 }; 43 44 bool cmp(peo a,peo b) 45 { 46 if(a.id==b.id) 47 { 48 if(a.all == b.all) 49 { 50 if(a.v == b.v ) 51 return (strcmp(a.num,b.num)<0); 52 else return a.v > b.v; 53 } 54 else return a.all > b.all; 55 } 56 else return a.id
VP; 69 for(i=0;i
=low && v>=low) 74 { 75 peo pp; 76 strcpy(pp.num,num); 77 pp.v=v; 78 pp.t=t; 79 pp.all=v+t; 80 if(v>=high && t>=high) 81 pp.id=1; 82 else if(v>= high && t
=t) 85 pp.id=3; 86 else 87 pp.id=4; 88 89 VP.push_back(pp); 90 } 91 } 92 93 sort(VP.begin(),VP.end(),cmp); 94 printf("%d\n",VP.size()); 95 for(i=0;i

 

转载于:https://www.cnblogs.com/xiaoyesoso/p/4265171.html

你可能感兴趣的文章
hibernate+mysql的连接池配置
查看>>
条件运算符 (?:)
查看>>
javascript Array(数组)
查看>>
HDU1518 Square 【剪枝】
查看>>
桥接模式
查看>>
android windows 上JNI编程
查看>>
PHP中可变变量到底有什么用?
查看>>
谈一谈最近关闭的Kindle人论坛
查看>>
android java 与C 通过 JNI双向通信
查看>>
javascript:另一种图片滚动切换效果思路
查看>>
获取css的属性值
查看>>
Win32_NetworkAdapterConfiguration
查看>>
Flash:DisplayObject的transform/matrix的潜规则、小bug
查看>>
方维系统常用的jquery库以及各个库的含义
查看>>
[LeetCode]101. Symmetric Tree
查看>>
Node.js的适用场景
查看>>
MongoDB 3.4 高可用集群搭建(二)replica set 副本集
查看>>
一个一线城市的IT白领的生活成本:3万/年
查看>>
ubuntu12.04 使用Adobe Reader PDF
查看>>
吃货联盟订餐系统(二)
查看>>