+ 1
Java "Argentina" challenge // Conditionals
What I have to do in this code? ttps://www.sololearn.com/coach/23?ref=app import java.util.Scanner; public class Argentina { public static void main(String[] args) { Scanner leer = new Scanner(System.in); int vPesos = leer.nextInt(); int vDolares = leer.nextInt(); vDolares *= 50; if(vPesos > vDolares) { System.out.print("Dollars"); } else if(vPesos < vDolares) { System.out.print("Pesos"); } } }
6 Réponses
+ 11
import java.util.Scanner;
public class Program{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int pesos=sc.nextInt();
int dollor=sc.nextInt();
pesos/=50;
if(pesos<dollor)
System.out.println("Pesos");
else
System.out.println("Dollars");
}
}
+ 2
Leandro Blandi
Guys use the search button. Already was answered today. Convert from pesos to dollars.
https://www.sololearn.com/Discuss/2125936/?ref=app
0
import java.util.Scanner;
public class Argentina {
public static void main(String[] args) {
Scanner leer = new Scanner(System.in);
int vPesos = leer.nextInt();
int vDolares = leer.nextInt();
vDolares *= 50;
if(vPesos > vDolares) {
System.out.print("Dollars");
}
else if(vPesos < vDolares) {
System.out.print("Pesos");
}
}
}
0
Throws me a error in the five #5 challenge
0
Take a look at my code. It might help.
int vPesos = input.nextInt();
int vDollars = input.nextInt();
vDollars *=51;
if(vPesos > vDollars) {
System.out.print("Dollars");
}
else if(vPesos < vDollars) {
System.out.print("Pesos");
}
- 1
Says me that the output it's not wanted