- 16
- 0
- 约5.51千字
- 约 7页
- 2017-09-28 发布于重庆
- 举报
程序设计竞赛选拔赛试题
黄淮学院第七届程序设计赛选拔赛试题
【T1】
数字拆解问题
【问题描述】
给定一个正整数N,请计算有多少种情况可以使得i*j+i+j=N。(N=i0, N=j0)
【输入】
输入的第一行为一个整数T,表示测试用例的个数。
随后是T行输入,每一行为一个正整数N(0=N=10000)。
【输出】
对于每个测试用例,输出对应的方法数。
【举例】
输入:
2
1
3
输出:
0
1
【T2】
A+B problem
【Description】
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.
【Input】
The first line of the input contains an integer T(1=T=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the integers are very large, that means you should not process them by using 32-bit integer. You may assume the length of each integer will not exceed 1000.
【Output】
For each test case, you should output two lines. The first line is Case #:, # means the number of the test case. The second line is the an equation A + B = Sum, Sum means the result of A + B. Note there are some spaces int the equation. Output a blank line between two test cases.
【Sample Input】
2
1 2
112233445566778899 998877665544332211
【Sample Output】
Case 1:
1 + 2 = 3
Case 2:
112233445566778899 + 998877665544332211 = 1111111111111111110
【T3】
小明的烦恼
【问题描述】
小明最近接到了一个棘手的任务,他们公司有一个电话簿.但是这是一个奇怪的电话簿,因为它不是用数字记录电话号码,而是用数字键上所对应的字母来记录电话号码(2-abc,3-def,4-ghi,5-jkl,6-mno,7-pqrs,8-tuv,9-wxyz),电话号码只有11位。现在你的任务就是帮小明写一个程序来把这些字母的电话号码转化成数字的电话号码。
【输入】
输入的第一行为一个正整数T(0T=100),表示测试用例的个数。
随后是T行输入,每一行为一串字符(字符长度为11)。
【输出】
每组输出占一行,输出数字的电话号码。
【举例】
输入:
2
phqghumeayl
nlfdxfircvs
cxggbwkfnqd
输出:
74744863295
65339347287
29442953673
【T4】
委派任务
某侦察队接到一项紧急任务,要求在A、B、C、D、E、F六个队员中尽可能多地挑若干人,但有以下限制条件:
1)A和B两人中至少去一人;
2)A和D不能一起去;
3)A、E和F三人中要派两人去;
4)B和C都去或都不去;
5)C和D两人中去一个;
6)若D不去,则E也不去。
问应当让哪几个人去?(输出格式:要去的人字母之间用空格隔开)
【T5】
Wacmian 数字
【问题描述】
在假设的Wacmahara无人沙漠里,一个非普通人组成的部落被发现了。Wacmians的每个手上仅有两个手指和一个拇指,并且他们发明了自己的数字系统。他们使用的数字和用来表示数字的符号都很奇特,但是人类学家已经能够以用下面的方法描述它们:
% -- 0
) -- 1
~ -- 2
@ -- 3
? -- 4
\ -- 5
$ -- -1 (没错,他们甚至有负数)
如你所愿,他们的系统是以6为基础的,每位上的数值达到6就像该位的左边进位,如同随后的例子:
)@% 表示 1*
原创力文档

文档评论(0)