0
My code won't pass test #5. What's wrong with it? Problem Argentina
#include <iostream> using namespace std; int main() { int peso, dollar, conv; string p = "Pesos"; string d = "Dollars"; cin >> peso; cin >> dollar; conv = dollar * 50; if ( peso > conv) { cout << d; } else cout << p; return 0; }
1 Respuesta
+ 2
Looks like the last test case is big enough to not fit in *int* as using *long int* fixes the problem.
Here is the fix👇
https://code.sololearn.com/cWl6AG5OFqI4/?ref=app