#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
if(a*b<0)
c=a;
a=b;
b=c;
cout<<a<<" "<<b;
}
else
c=a+b;
cout<<c;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
if(a*b<0)
{
c=a;
a=b;
b=c;
cout<<a<<" "<<b;
}
else
{
c=a+b;
cout<<c;
}
return 0;
}