조금 쉬웠던 문제였다
package D3;
import java.util.Scanner;
public class 직사각형길이찾기 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int tc = 1; tc<=T; tc++) {
int arr[] = new int[3];
int cnt[] = new int[101];
for(int i =0; i<3; i++) {
arr[i] = sc.nextInt();
cnt[arr[i]]++;
}
int idx =0 ;
for(int i =1; i<101; i++) {
if(cnt[i] == 1 || cnt[i] == 3) {
idx = i;
System.out.println("#" + tc + " " + idx);
}
}
}
}
}
'알고리즘 > SwExpert recipe' 카테고리의 다른 글
[SWEA] 두문자어 [D3] (0) | 2021.04.08 |
---|---|
[SWEA] 민석이의 과제제출하기 [D3] (0) | 2021.03.29 |
[SWEA] 사람 네트워크 D6 (0) | 2021.03.25 |
[SWEA] 준홍이의카드놀이 D3 (0) | 2021.03.25 |
[SWEA] 동철이의 프로그래밍 대회 D3 (0) | 2021.03.20 |