Guest User

Untitled

a guest
Sep 9th, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5.  
  6. Scanner sc = new Scanner(System.in);
  7. double a = sc.nextDouble(), b = sc.nextDouble(), c = sc.nextDouble(), d = sc.nextDouble(), e = sc.nextDouble();
  8. double[] arrayNumbers = {a,b,c,d,e};
  9. //System.out.print(Arrays.toString(arrayNumbers));
  10. double max = arrayNumbers[0];
  11. for (int i =1; i < arrayNumbers.length; i++)
  12. {
  13. if (arrayNumbers[i] > max)
  14. {
  15. max = arrayNumbers[i];
  16. }
  17. }
  18. System.out.println((int)max);
  19. sc.close();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment