1132:0 start-up algorithm 39--multiple sets of test data (A+B)

Source: Internet
Author: User

1132:0 start-up algorithm 39--multiple sets of test data (a+b) time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:1790 accepted:1222
[Submit] [Status] [Web Board] Description

Calculate a+b. Many of the topics test data will have many groups, generally our online system does not write specific requirements, the input is the end of EOF. The basic framework of the problem is as follows:



int main ()
{
int A, B;
while (scanf ("%d%d", &a,&b)!=eof) //Pay special attention to the wording of this line
{
...//sum
...//output
} return 0;
}



The scanf function has a return value, and if a number is successfully read from the keyboard, the return value is 1, and if 2 is read successfully, 2 is returned. If the end of the file is processed, EOF is returned
Special Note: The requirements of the topic actually refers to the end of each set of data input, immediately output the results of this group, rather than waiting for all the data after the output results

Input

Input as multiple sets of test data. Each row, enter 2 integers a and b per line

Output

For each set of test data, output one line and output the value of a+b until the end of the file

Sample Input
1 12 23 3

Sample Output
246

HINT

Long long can help you

Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     intb;4      while(SCANF ("%d%d", &a,&b)! =EOF) {5printf"%d\n", A +b);6     }7     return 0;8}

1132:0 start-up algorithm 39--multiple sets of test data (A+B)

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.