- 1、本文档共3页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
湛江师范学院2014年度ACM蓝桥杯校内选拔赛题目
湛江师范学院2014年度ACM/蓝桥杯校内选拔赛题目
(可自由选择C/C++/JAVA实现)
注意:每个题目完成后请将,每做完一题发送一题,邮件主题统一命名为“姓名+第X题”。
-----------------------------------------------------------------------------------------
A+B Problem
Problem Description
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair of integers a and b, separated by a space, one pair of integers per line.
Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.
Sample Input
2
1 5
10 20
Sample Output
6
30
----------------------------------------------------------------------------------------------------------------------
排序
Problem Description
数组排序。
Input
整数00),每个整数值为1000以内的正整数。
Output
从小到大排列的Sample Input
34 21 56 86 19 6 78 32
Sample Output
6 19 21 32 34 56 78 86
----------------------------------------------------------------------------------------------------------------------
对称三位数素数
Problem Description
判断一个数是否为对称三位数素数。所谓“对称”是指一个数,倒过来还是该数。例如,375不是对称数,因为倒过来变成了573。
Input
输入数据含有不多于50个的正整数(0n2^32)。
Output
对于每个n,如果该数是对称三位数素数,则输出“Yes”,否则输出“No”。每个判断结果单独一行。
Sample Input
11 101 272
Sample Output
No
Yes
No
----------------------------------------------------------------------------------------------------------------------
Elevator
Problem Description
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The elevator will stay for 5 seconds at each stop.
For a given request list, you are to compute the total time spent to fulfill the requests on the list. The elevator is on the 0th floor at the beginning and does not have to return to the ground floor when the requests are fulfilled.
Input
There are multiple test cases. Each case
文档评论(0)