POJ 1000

来源:互联网 发布:ubuntu likewise open 编辑:程序博客网 时间:2024/06/07 16:36

 POJ 1000

A+B Problem

Time Limit: 1000MS

 

Memory Limit: 10000K

Total Submissions: 291052

 

Accepted: 158953

Description

Calculate a+b

Input

Two integer a,b (0<=a,b<=10)

Output

Output a+b

Sample Input

1 2

Sample Output

3

代表意义的一道题了= =

问题翻译:计算a+b的值

输入:两个整数ab,输出:a+b的值

C++代码:

#include <iostream> using namespace std; int main(){       int a,b;       while(cin>>a>>b) {cout<<a+b<<endl;}       //while语句用于重复读入       return 0;}


 

小结: C++中重复读入语句:while(cin>>a>>b)  很简洁

        第一次打代码include前面居然忘了打#,这是有多弱= =

原创粉丝点击