0
About the Argentina coach code
What will happen if the price in pesos is equal to the price in dollars , i almost solved solved the problem still have one case which is not verified and it s hidden .
7 Respostas
+ 4
TheGirlHasNoName
oh! Even I had this problem. They have not mentioned, but the input can be a float too. So change type of all the variables to `float` and instead of int input, take float input.
+ 4
My solution works and it only outputs "Pesos" when price in pesos is *smaller than* that in dollars. So even if the prices are equal, it outputs "Dollars".
+ 2
a=int(input())
d=int(input())
if (a*2)/100 <d:
print('Pesos')
else:
print('Dollars')
+ 1
Thanks , the problem wasn't in my code but they did not mention the variables can be float , now it works and i dod solve it using java
0
Okay let me try if it doesn't work ill post my solution and thanks XXX
0
import java.util.Scanner ;
public class Program
{
public static void main(String[] args) {
Scanner input=new Scanner (System .in);
int costPesos=input.nextInt();
int costDollar=input.nextInt();
int pesostocents=2*costPesos;
int dollartocents=100*costDollar;
if(pesostocents<dollartocents){
System .out.println("Pesos");
}else{
System .out.println ("Dollars");
}
}
}
0
Thanks XXX it works yes the problem is fixed once i switched the type to float