Advertisement
marinjordanov

Biggest of Three

Sep 17th, 2021
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BiggestOfThree {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double a = Double.parseDouble(scanner.nextLine());
  7. double b = Double.parseDouble(scanner.nextLine());
  8. double c = Double.parseDouble(scanner.nextLine());
  9.  
  10. if (a >= -200 & a <= 200 & b >= -200 & b <= 200 & c >= -200 & c <= 200) {
  11. if (a >= b & a >= c) {
  12. System.out.printf("%.0f",a);
  13. } else System.out.printf("%.0f",Math.max(b, c));
  14. }
  15.  
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement