Guest User

Untitled

a guest
Dec 20th, 2018
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.text.DecimalFormat;
  2. import java.util.Scanner;
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         DecimalFormat df = new DecimalFormat("##.##");
  7.         Scanner in = new Scanner(System.in);
  8.         float arr1[] = new float[3];
  9.         float max = -200;
  10.         for(int i =0;i<arr1.length;i++){
  11.             float input = in.nextFloat();
  12.             arr1[i] = input;
  13.             if (arr1[i]>max){
  14.                 max = arr1[i];
  15.             }
  16.         }
  17.         System.out.print(df.format(max));
  18.     }
Add Comment
Please, Sign In to add comment