[1000]a + B problem (1)

Source: Internet
Author: User

1000:a+b problem (1) Time limit:10 Sec Memory limit:125 MB
submit:745 solved:307

Your task is to Calculate A + B.


The input would consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.



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

[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!


 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.