Notice
Recent Posts
Recent Comments
Link
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Archives
Today
Total
관리 메뉴

최's 먹공로그

SW expert Academy 3456_직사각형 길이 찾기 본문

APS

SW expert Academy 3456_직사각형 길이 찾기

ChoiSH313 2019. 2. 3. 17:47

https://www.swexpertacademy.com/main/code/problem/problemDetail.do

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.util.Scanner;
 
public class Z24_SWExpert3456_직사각형길이찾기 {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int tc = sc.nextInt();
        
        for(int i = 1; i <= tc; i++) {
            
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int d = a ^ b ^ c;
            /**
             * a = 4, b = 3, c = 4 일때
             * a = 100(2), b = 011(2) a^b = 111(2)
             * 111(2) ^ c(100)(2) = 011(2)
             * 
             */
            
            System.out.println("#" + i + " " + d);
            
            
        } // end of tc
    } // end of main
}
 
cs