why this solution is wrong?
Posted by
Gleb 3 Jun 2019 15:06
#include<iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
int d;
int h;
cin>>a;
cin>>b;
h=a-1+b;
c=h-a;
d=h-b;
cout<<c;
cout<<d;
return 0;
}
Re: why this solution is wrong?
You should test your code locally before submitting, this way you will notice that you missed a space!
Re: why this solution is wrong?
Posted by
ZamaaN 16 May 2021 03:02
I've simplified your way. use the following, you'll get the result -
c = b - 1;
d = a - 1;
cout<<c<<" "<<d;
Edited by author 16.05.2021 03:02