ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [백준] 2959번 거북이 문제풀이
    알고리즘/Baekjoon 2020. 7. 18. 15:23

     

     

    풀이 방법

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Arrays;
    import java.util.StringTokenizer;
    
    public class Main {
    
    	public static void main(String[] args) throws IOException {
    
    		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    		StringTokenizer st = new StringTokenizer(br.readLine());
            
            int[] arr = new int[4];
    		for(int i=0; i<arr.length; i++) {
    			arr[i] = Integer.parseInt(st.nextToken());
    		}
    		
    		Arrays.sort(arr);
    		System.out.println(arr[0] * arr[2]);
    	}
    }

    댓글

Designed by Tistory.