Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.text.DecimalFormat;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- DecimalFormat df = new DecimalFormat("##.##");
- Scanner in = new Scanner(System.in);
- float arr1[] = new float[3];
- float max = -200;
- for(int i =0;i<arr1.length;i++){
- float input = in.nextFloat();
- arr1[i] = input;
- if (arr1[i]>max){
- max = arr1[i];
- }
- }
- System.out.print(df.format(max));
- }
Add Comment
Please, Sign In to add comment