#3706: 簡單加法 這樣為啥不行 拜托教我 我新手


winoslayer1 (阿甫Leo)


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{

int a,b,c,d;
cin >> a >> b >>c >> d ;

cout << (a+b) << endl;

cout << (c+d) << endl;

system("PAUSE");

return 0 ;


}

#3708: Re:簡單加法 這樣為啥不行 拜托教我 我新手


linishan (L)


#include
#include

using namespace std;

int main(int argc, char *argv[])
{

int a,b,c,d;
cin >> a >> b >>c >> d ;

cout << (a+b) << endl;

cout << (c+d) << endl;

system("PAUSE");

return 0 ;


}

題目意思是會有多"組" 2個數字的測資

請用 while(cin>>a>>b)