Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- double a = sc.nextDouble(), b = sc.nextDouble(), c = sc.nextDouble(), d = sc.nextDouble(), e = sc.nextDouble();
- double[] arrayNumbers = {a,b,c,d,e};
- //System.out.print(Arrays.toString(arrayNumbers));
- double max = arrayNumbers[0];
- for (int i =1; i < arrayNumbers.length; i++)
- {
- if (arrayNumbers[i] > max)
- {
- max = arrayNumbers[i];
- }
- }
- System.out.println((int)max);
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment