1、ACM:Association for Computing Machinery 美国计算机协会美国计算机协会 ICPC:International Collegiate Programming Contest 国际大学生程序设计竞赛国际大学生程序设计竞赛 ACM/ICPC 由美国计算机协会主办的国际大学生程序设计竞赛由美国计算机协会主办的国际大学生程序设计竞赛ACM/ICPC 是世界上公认的历史悠久、规模最大、水平是世界上公认的历史悠久、规模最大、水平最高的国际大学生程序设计竞赛。最高的国际大学生程序设计竞赛。56如何比赛如何比赛?3人组队人组队79如何排名?如何排名?101112 C:sca
2、nf 速度快速度快 printf 格式容易控制格式容易控制 C+:cin使用简单使用简单,自动识别类型自动识别类型 cout 格式控制较麻烦格式控制较麻烦数据规模较大时数据规模较大时,推荐推荐(必须必须)使用使用scanf 以避免超时以避免超时(TLE)C和和C+的输入输出混合使用的输入输出混合使用2930Problem DescriptionYour task is to Calculate a+b.Too easy?!Of course!I specially designed the problem for ACM beginners.You must have found that s
3、ome problems have the same titles with this one,yes,all these problems were designed for the same aim.InputThe input will consist of a series of pairs of integers a and b,separated by a space,one pair of integers per line.OutputFor each pair of input integers a and b you should output the sum of a a
4、nd b in one line,and with one line of output for each line in input.Sample Input1 510 20Sample Output63031323334Problem DescriptionYour task is to Calculate a+b.InputInput 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
5、space,one pair of integers per line.OutputFor 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 Input21 510 20Sample Output63035 for(i=0;in;i+)36Problem DescriptionYour task is to Calculate a+b.InputInput co
6、ntains multiple test cases.Each test case contains a pair of integers a and b,one pair of integers per line.A test case containing 0 0 terminates the input and this test case is not to be processed.OutputFor each pair of input integers a and b you should output the sum of a and b in one line,and wit
7、h one line of output for each line in input.Sample Input1 510 200 0Sample Output630Problem DescriptionYour task is to Calculate the sum of some integers.InputInput contains multiple test cases.Each test case contains a integer N,and then N integers follow in the same line.A test case starting with 0
8、 terminates the input and this test case is not to be processed.OutputFor each group of input integers you should output their sum in one line,and with one line of output for each line in input.Sample Input4 1 2 3 45 1 2 3 4 50 Sample Output1015Problem DescriptionYour task is to calculate the sum of
9、 some integers.InputInput contains an integer N in the first line,and then N lines follow.Each line starts with a integer M,and then M integers follow in the same line.OutputFor each group of input integers you should output their sum in one line,and with one line of output for each line in input.Sa
10、mple Input24 1 2 3 45 1 2 3 4 5Sample Output1015Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases,and one case one line.Each case starts with an integer N,and then N integers follow in the same line.OutputFor each test case you should outpu
11、t the sum of N integers in one line,and with one line of output for each line in input.Sample Input4 1 2 3 45 1 2 3 4 5Sample Output1015Problem DescriptionYour task is to Calculate a+b.InputThe input will consist of a series of pairs of integers a and b,separated by a space,one pair of integers per
12、line.OutputFor each pair of input integers a and b you should output the sum of a and b,and followed by a blank line.Sample Input1 510 20Sample Output630Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line,and then N lines follow.Ea
13、ch line starts with a integer M,and then M integers follow in the same line.OutputFor each group of input integers you should output their sum in one line,and you must note that there is a blank line between outputs.Sample Input34 1 2 3 45 1 2 3 4 53 1 2 3Sample Output1015643 最好不要进行函数声明最好不要进行函数声明 变量
14、定义在使用之前变量定义在使用之前 避免避免for(int i=0;i n;i+)i的使用范围仅仅在的使用范围仅仅在for内部,容易导致内部,容易导致CE 遇到问题首先自己查找资料,之后再提问遇到问题首先自己查找资料,之后再提问44Problem DescriptionGive you an operator(+,-,*,/-denoting addition,subtraction,multiplication,division respectively)and two positive integers,your task is to output the result.Is it very
15、 easy?Come on,guy!PLMM will send you a beautiful Balloon right now!Good Luck!InputInput contains multiple test cases.The first line of the input is a single integer T(0T1000)which is the number of test cases.T test cases follow.Each test case contains a char C(+,-,*,/)and two integers A and B(0A,B10000).Of course,we all know that A and B are operands and C is an operator.OutputFor each case,print the operation result.The result should be rounded to 2 decimal places If and only if it is not an integer.Sample Input4+1 2-1 2*1 2/1 2Sample Output3-120.5045有什么问题?有什么问题?