fork download
  1. #include<iostream>
  2. #include<algorithm>
  3. using namespace std;
  4. int main()
  5. {
  6. int t,a,b,i,c;
  7. cin>>t;
  8. if(t>=1&&t<=100)
  9. {
  10.  
  11. for(i=t;i>0;i--)
  12. {
  13. cin>>a>>b;
  14. int minimum=max(a,b);// these min and max functions are included in algorithm header file
  15. int maximum=a+b;
  16. cout<< minimum<<" "<<maximum<<endl;
  17. }
  18.  
  19. }
  20. else return 0;
  21. }
  22.  
Success #stdin #stdout 0s 3300KB
stdin
1
19 17
stdout
19 36