从零开始刷HDOJ(1)【HDOJ1000 - a+b problem】
题面
A + B Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
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
Author
HDOJ
Recommend
We have carefully selected several similar problems for you: 1089 1002 1090 1091 1092
Statistic | Submit | Discuss | Note
翻译
输入a, b,输出a + b。
思路
和各大OJ一样,第一道题一般就是a+b problem。
代码
#include <iostream>
int main(int argc, char ** argv)
{
int x, y;
while (std::cin >> x >> y)
std::cout << x + y << std::endl;
//底下就是暂停用的,不用管。
#ifdef __EDWARD_EDIT
std::cin.get();
std::cin.get();
#endif
return 0;
}

本文详细解析了HDOJ1000 A+B问题,包括题目描述、输入输出要求及示例,并提供了一种简单有效的C++实现方案。

578

被折叠的 条评论
为什么被折叠?



