runtime error in c++

what is wrong with my code?
it shows runtime error

#include
using namespace std;
int main()
{int t,a,b,i,c;
cin>>t;
if(t>=1&&t<=100)
{
for(i=0;i<t;i++)
cin>>a>>b;
if(a>b)
c=a;
else c=b;
return(c,a+b);
}
else return 0;
}

Bro the way you have to do is to print the answer. There is a big difference between Topcoder and codechef, here in codechef you just need to return the value. Here your output file will be matched with the correct outfile with the server. If both are matching then you get an Accepted else you will not. Here you got Runtime Error because you are not printing the answer instead you are returning the some answer to the main function. Hope you got what i meant. If you have any doubt please do ask …:slight_smile:

Here is the correct answer. link text

HAPPY CODING

Here is your code. I debugged it here

HAPPY CODING