-
[java]백준 N번째 큰 수 2693번알고리즘 문제풀이/백준(자바) 2023. 4. 30. 23:22
코드
import java.util.Arrays; import java.util.Scanner; public class BOJ_2693 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[10];//a원소 저장 int[] w = new int[n];//7번째 배열값 저장 for (int i = 0; i < n; i++) { for (int j = 0; j <10; j++) { a[j]= in.nextInt();//배열에 저장 } Arrays.sort(a);//정렬하고 w[i]=a[7];//7번째 배열값 저장 } for (int z : w) {//w에 저장한 7번째 배열값 출력 System.out.println(z); } in.close(); } }
링크
https://www.acmicpc.net/problem/2693
'알고리즘 문제풀이 > 백준(자바)' 카테고리의 다른 글
[java]백준 몇개고? 27294번 (0) 2023.05.02 [java]백준 소수 찾기 1978번 (0) 2023.05.01 [java]백준 엄청난 부자2 1271번 (0) 2023.04.29 [java]백준 수 정렬하기 3 10989번 (0) 2023.04.28 [java]백준 A+B 26711번 (0) 2023.04.27