#include <iostream>
using namespace std;
int main() {
int t , b , a ;
cin>>t;
for(int a = 1 ; a<=t ; a++){
for(int b = 1 ; b<=t ; b++)
}
cout<<a+b<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
}
return 0;
}
The question is quite simple but you are making it complex. The question asks you take input of two integers t number of times and just add them.
So the right code would be :-
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
}
return 0;
}