티스토리 뷰

반응형


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.util.Scanner;
// 2070. 큰 놈, 작은 놈, 같은 놈
public class Solution2070 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int T = scan.nextInt();
        
        for(int i=0; i<T; i++) {
                int n1 = scan.nextInt();
                int n2 = scan.nextInt();
                System.out.print("#"+(i+1)+" ");
                if(n1 == n2) 
                    System.out.println("=");
                else if(n1 > n2)
                    System.out.println(">");
                else 
                    System.out.println("<");
        }
    }
}
cs



> Best Solution

1
2
3
4
5
6
7
8
9
10
11
12
13
import java.util.Scanner;
 
public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int i=0; i<T; i++) {
            int n1 = sc.nextInt();
            int n2 = sc.nextInt();
            System.out.println("#"+(i+1)+" "+(n1==n2?"=":n1<n2?"<":">"));
        }
    }
}
cs


반응형
댓글
최근에 올라온 글
최근에 달린 댓글
링크
Total
Today
Yesterday