1. 程式人生 > >HDU-1000 A+B Problm (語法練習題)

HDU-1000 A+B Problm (語法練習題)

A+B Problem

A + B Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 832597 Accepted Submission(s): 251888

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

問題簡述:

  輸入兩個數,輸出它們的和。

問題分析:

  讀取輸入,輸出結果。

程式說明:

  使用兩個int型別的數儲存輸入,直接輸出和。使用c++標準輸入輸出流。

程式實現:

#include<iostream>
using namespace std;

int main()
{
    int a,b;
    while(cin>>a>>b)
    {
        cout<<a+b<<
endl; } }