摘要: 读入n名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。 输入格式:每个测试输入包含1个测试用例,格式为 其中姓名和学号均为不超过10个字符的字符串,成绩为0到100之间的一个整数,这里保证在一组测试用例中没有两个学生的成绩是相同的。 输出格式:对每个测试用例输出2行,第1行是成 阅读全文
posted @ 2018-03-08 14:55 王清河 阅读(169) 评论(0) 推荐(0)
摘要: 每个PAT考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生需要换到考试座位就座。但有些考生迟到了,试机已经结束,他们只能拿着领到的试机座位号码求助于你,从后台查出他们的考试 阅读全文
posted @ 2018-03-08 14:36 王清河 阅读(126) 评论(0) 推荐(0)
摘要: This time, you are supposed to find A*B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu 阅读全文
posted @ 2018-03-08 14:08 王清河 阅读(115) 评论(0) 推荐(0)
摘要: Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the p 阅读全文
posted @ 2018-03-08 08:08 王清河 阅读(107) 评论(0) 推荐(0)
摘要: The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of e 阅读全文
posted @ 2018-03-07 20:35 王清河 阅读(102) 评论(0) 推荐(0)
摘要: Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "ins 阅读全文
posted @ 2018-03-07 19:59 王清河 阅读(122) 评论(0) 推荐(0)
摘要: As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some ro 阅读全文
posted @ 2018-03-07 18:08 王清河 阅读(174) 评论(0) 推荐(0)
摘要: 正整数A的“DA(为1位整数)部分”定义为由A中所有DA组成的新整数PA。例如:给定A = 3862767,DA = 6,则A的“6部分”PA是66,因为A中有2个6。 现给定A、DA、B、DB,请编写程序计算PA + PB。 输入格式: 输入在一行中依次给出A、DA、B、DB,中间以空格分隔,其中 阅读全文
posted @ 2018-02-12 14:26 王清河 阅读(112) 评论(0) 推荐(0)
摘要: 宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。” 现给出一批考生的德才分数,请根据司马光的理论给出录取排名。 输入格式: 输入第1行给出3个正整数,分别为: 阅读全文
posted @ 2018-02-05 23:22 王清河 阅读(180) 评论(0) 推荐(0)
摘要: 大侦探福尔摩斯接到一张奇怪的字条:“我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm”。大侦探很快就明白了,字条上奇怪的乱码实际上就是约会的时间“星期四 14:04”,因为前面两字符串中第1对相同的大写英文字母(大小写有区分)是 阅读全文
posted @ 2018-02-02 21:36 王清河 阅读(154) 评论(0) 推荐(0)