Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BiggestOfFive {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double a = Double.parseDouble(scanner.nextLine());
- double b = Double.parseDouble(scanner.nextLine());
- double c = Double.parseDouble(scanner.nextLine());
- double d = Double.parseDouble(scanner.nextLine());
- double e = Double.parseDouble(scanner.nextLine());
- if (a >= -200 & a <= 200 & b >= -200 & b <= 200 & c >= -200 & c <= 200 & d >= -200 & d <= 200 && e >= -200 & e <= 200) {
- if (a >= b & a >= c & a >= d & a >=e ){
- System.out.printf("%.0f",a).println();}
- if (b>a & b>=c & b>=d & b>=e){
- System.out.printf("%.0f",b).println();}
- if (c>a & c>=b & c>=d & c>=e){
- System.out.printf("%.0f",c).println();}
- if (d>a & d>=b & d>=c & d>=e){
- System.out.printf("%.0f",d).println();}
- else { if (e>a)
- System.out.printf("%.0f",e).println();}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement