티스토리 뷰
반응형
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 |
반응형
'PS > Problem_Solving' 카테고리의 다른 글
[SWEA] 2058. 자릿수 더하기(JAVA) (0) | 2019.04.15 |
---|---|
[SWEA] 2063. 중간값 찾기(JAVA) (0) | 2019.04.15 |
[SWEA] 2068. 최대수 구하기(JAVA) (0) | 2019.04.15 |
[SWEA] 2071. 평균값 구하기(JAVA) (0) | 2019.04.05 |
[SWEA] 2072. 홀수만 더하기(JAVA) (0) | 2019.04.05 |
댓글