"SWEA 2070 큰 놈, 작은 놈, 같은 놈"의 두 판 사이의 차이

1번째 줄: 1번째 줄:
==개요==
==개요==
;SWEA 2070 큰 놈, 작은 놈, 같은 놈
;SWEA 2070 큰 놈, 작은 놈, 같은 놈
*  
* https://www.swexpertacademy.com/main/code/problem/problemSubmitHistory.do?contestProbId=AV5QQ6qqA40DFAUq


{{SWEA 헤더}}
{{SWEA 헤더}}
13번째 줄: 13번째 줄:
==Java==
==Java==
<source lang='java'>
<source lang='java'>
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 t=1; t<=T; t++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            char result;
            if( a > b ) result = '>';
            else if( a == b ) result = '=';
            else result = '<';
            System.out.format( "#%d %c\n", t, result);           
        }
    }
}
</source>
</source>

2018년 9월 6일 (목) 20:05 판

1 개요

SWEA 2070 큰 놈, 작은 놈, 같은 놈
SW Expert 아카데미
# 문제 풀이

틀:SWEA 난이도 1-1

2 C++

3 Java

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 t=1; t<=T; t++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            char result;
            if( a > b ) result = '>';
            else if( a == b ) result = '=';
            else result = '<';
            System.out.format( "#%d %c\n", t, result);            
        }
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}