Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner userInput = new Scanner(System.in);
- String a = userInput.nextLine();
- String b = userInput.nextLine();
- String c = userInput.nextLine();
- String d = userInput.nextLine();
- String e = userInput.nextLine();
- double ad = Double.parseDouble(a);
- double bd = Double.parseDouble(b);
- double cd = Double.parseDouble(c);
- double dd = Double.parseDouble(c);
- double ed = Double.parseDouble(c);
- String result = a;
- if (bd > ad) {
- result = b;
- }
- if (cd > bd) {
- result = c;
- }
- if (dd > cd) {
- result = d;
- }
- if (ed > dd) {
- result = e;
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment