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

Wrong answer
Posted by Pavel 24 Feb 2015 16:31
why wrong answer?
#include <iostream>
using namespace std;
int main()
{
    int banki=10, banki_s, bankis_ss;
    cout << "Harry shot cans: ";
    cin >> banki_s;
    cout << "Larry shot cans: ";
    cin >> bankis_ss;
cout << "Harry shot: " << (banki - banki_s) << endl;
cout << "Larry shot: " << (banki - bankis_ss) << endl;

    return 0;
}
Re: Wrong answer
Posted by Pavel 24 Feb 2015 16:47
int main()
{
    code:
        int banki, banki_s, bankis_ss;
    cout << "Harry shot cans: ";
    cin >> banki_s;
    cout << "Larry shot cans: ";
    cin >> bankis_ss;
    banki = (banki_s + bankis_ss) - 1;
        cout << "Harry shot: " << (banki - banki_s) << endl;
        cout << "Larry shot: " << (banki - bankis_ss) << endl;
    system("PAUSE");
    return 0;
}