+ 1
Test case 5 is not working for Argentina code coach problem
#include <iostream> using namespace std; int main() { int pesos; int dollars; cin>>pesos; cin>>dollars; int answer=dollars*50; if(answer>=pesos){ cout<<"Pesos"; } else { cout<<"Dollars"; } return 0; }
3 ответов
+ 2
I understood know I was using int I had to use double.
+ 3
Solved first code works by using double
+ 1
Can you tell me the difference b/w the code above and this. I think logic is same in both
#include <iostream>
using namespace std;
int main() {
int pesos;
int dollars;
cin>>pesos;
cin>>dollars;
int answer=pesos/50;;
if(answer<=pesos){
cout<<"Pesos";
}
else {
cout<<"Dollars";
}
return 0;
}