pages:
  • 1
~recursive SAYS

my code is:

include

using namespace std; int main() { int a,b; while(1) { cin>>a>>b; cout<<a+b<<endl; } return 0; } why the system give me "Output Limit Exceeded"???? plaese help me :-(

Hita Barasm Mamagani SAYS

~recursive said:

my code is:

include

using namespace std; int main() { int a,b; while(1) { cin>>a>>b; cout<<a+b<<endl; } return 0; } why the system give me "Output Limit Exceeded"???? plaese help me :-(

Hi, because you use while(1) so the program will never end. if you use while(cin>>a>>b) it will work fine, and accepted!

Sajad Ahmadi SAYS

include

using namespace std;

while (cin >> a >> b)
    cout <<a+b<< endl ;