ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1409. Two Gangsters

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?
Posted by Theofratus 21 Aug 2020 10:33
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