|
|
back to boardwrong answer Posted by Freddy 25 Jul 2011 00:00 why wrong answer? #include"iostream" int main() {
int banki=10; int Garry,Larry; std::cin>>Garry>>Larry; std::cout<<banki-Garry<<" "<<banki-Larry; return 0; } Re: wrong answer Posted by ISS 22 Jun 2012 21:05 because its wrong - int banki=10 Re: wrong answer Why this solution is wrong? #include <iostream> using namespace std; int main() { int herry; int larry; int all; cin >> herry; cin >> larry; all=herry+larry-1; herry=all-larry; larry=all-herry; cout << herry << " " << larry; return 0; } Edited by author 03.07.2013 01:45 Re: wrong answer =) Do you know math? Code: all=herry+larry-1; herry=all-larry; larry=all-herry; Math: all=herry+larry-1; herry=all-larry=herry+larry-1-larry=herry-1; larry=all-herry=herry+larry-1-(herry-1)=larry; Edited by author 25.09.2013 18:28 Re: wrong answer actually the twist is in the number of total canes. Edited by author 26.05.2021 02:53 Edited by author 26.05.2021 02:53 |
|
|