首页 > 技术文章 > 1000 A+B [ACM刷题]

zuilehongdou 2016-03-11 16:59 原文

这一段时间一直都在刷OJ,这里建一个博客合集,用以记录和分享算法学习的进程。
 
Problem Description
Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
1 1
Sample Output
2

 

CODE
#include <iostream>
int main()
{
    int a, b;
    while(std::cin >> a >> b)
    {
        std::cout << a + b << std::endl;
    }
    return 0;
}

 

推荐阅读