Skip to content

Commit

Permalink
CT_346
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-Good committed Dec 27, 2024
1 parent 280ea6e commit 9d55d17
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions BOJ/Java/src/B2/Boj_5576_콘테스트.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package B2;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;

public class Boj_5576_콘테스트 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringBuilder sb = new StringBuilder();

for (int i = 0; i < 2; i++) {

int[] arr = new int[10];

for (int j = 0; j < 10; j++) {
arr[j] = Integer.parseInt(br.readLine());
}

Arrays.sort(arr);

int sum = 0;

for (int j = 9; j >= 7; j--) {
sum += arr[j];
}
sb.append(sum).append(' ');
}

bw.write(sb.toString());
bw.flush();
}
}

0 comments on commit 9d55d17

Please sign in to comment.