題目:https://vjudge.net/problem/hdu-1000?tdsourcetag=s_pctim_aiomsg
思路:用循環來使每次輸入的a,b相加。
c++代碼如下:
#include <iostream>
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
cout<< a + b << endl;
}
return 0;
}