Advertisement
Guest User

Biggest of Three

a guest
Dec 20th, 2018
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. package com.telerikacademy.oop;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         String x = in.nextLine();
  11.         String y = in.nextLine();
  12.         String z = in.nextLine();
  13.  
  14.         double xd = Double.parseDouble(x);
  15.         double yd = Double.parseDouble(y);
  16.         double zd = Double.parseDouble(z);
  17.  
  18.         if (xd >= yd && xd >= zd) {
  19.             System.out.println(x);
  20.         } else if (yd >= xd && yd >= zd) {
  21.             System.out.println(y);
  22.         } else {
  23.             System.out.println(z);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement