1000:a+b problem (1) Time limit:10 Sec Memory limit:125 MB
submit:745 solved:307
Description
Your task is to Calculate A + B.
Input
The input would consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.
(0<=a,b<=10000)
Output
For each pair of input integers a and b you should output the sum of A and B on one line, and with one line of output for Each line in input.
Sample Input
1 510 20
Sample Output
630
[Ideas] hard to say, is to declare two variables of type int, then remember to assign values, and then put them and output, attention to the processing of EOF, if the use of scanf input, you can write ~scanf (...) You'll jump out when you hit EOF!
Code
1 #include <iostream>2 using namespace Std; 3 int main () 5 { int A, b; 7 while (cin >> a >> b) cout < ;< A + b << Endl; 8 return 0 9 }
[1000]a + B problem (1)