Guest User

Untitled

a guest
Jul 22nd, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner userInput = new Scanner(System.in);
  8.  
  9.         String a = userInput.nextLine();
  10.         String b = userInput.nextLine();
  11.         String c = userInput.nextLine();
  12.         String d = userInput.nextLine();
  13.         String e = userInput.nextLine();
  14.  
  15.         double ad = Double.parseDouble(a);
  16.         double bd = Double.parseDouble(b);
  17.         double cd = Double.parseDouble(c);
  18.         double dd = Double.parseDouble(c);
  19.         double ed = Double.parseDouble(c);
  20.  
  21.         String result = a;
  22.  
  23.         if (bd > ad) {
  24.             result = b;
  25.         }
  26.  
  27.         if (cd > bd) {
  28.             result = c;
  29.         }
  30.        
  31.         if (dd > cd) {
  32.             result = d;
  33.         }
  34.  
  35.         if (ed > dd) {
  36.             result = e;
  37.         }
  38.  
  39.         System.out.println(result);
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment