Skip to content

Commit

Permalink
[Bronze V] Title: 두 수 비교하기, Time: 132 ms, Memory: 14396 KB -BaekjoonHub
Browse files Browse the repository at this point in the history
  • Loading branch information
dukbong committed Sep 19, 2023
1 parent 898f120 commit 5707efc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 백준/Bronze/1330. 두 수 비교하기/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# [Bronze V] 두 수 비교하기 - 1330

[문제 링크](https://www.acmicpc.net/problem/1330)

### 성능 요약

메모리: 14396 KB, 시간: 132 ms

### 분류

구현

### 문제 설명

<p>두 정수 A와 B가 주어졌을 때, A와 B를 비교하는 프로그램을 작성하시오.</p>

### 입력

<p>첫째 줄에 A와 B가 주어진다. A와 B는 공백 한 칸으로 구분되어져 있다.</p>

### 출력

<p>첫째 줄에 다음 세 가지 중 하나를 출력한다.</p>

<ul>
<li>A가 B보다 큰 경우에는 '<code>></code>'를 출력한다.</li>
<li>A가 B보다 작은 경우에는 '<code><</code>'를 출력한다.</li>
<li>A와 B가 같은 경우에는 '<code>==</code>'를 출력한다.</li>
</ul>

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.io.*;
import java.util.*;

public class Main{
public static void main(String[] args) throws IOException{
new Main().solution();
}
private void solution() throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] arr = Arrays.stream(br.readLine().split(" "))
.mapToInt(Integer::parseInt).toArray();
String result = "==";
if(arr[0] > arr[1])
result = ">";
else if (arr[0] < arr[1])
result = "<";
System.out.println(result);
}
}

0 comments on commit 5707efc

Please sign in to comment.