-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.util.StringTokenizer; | ||
|
||
public class PROB1330 { | ||
// 두 정수 A 와 B 가 주어졌을 떄, A 와 B 를 비교하는 프로그램을 작성하세요. | ||
public static void main(String[] args) throws IOException { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
StringTokenizer st = new StringTokenizer(br.readLine()); | ||
|
||
int A = Integer.parseInt(st.nextToken()); | ||
int B = Integer.parseInt(st.nextToken()); | ||
|
||
String output = (A > B) ? ">" : (A == B) ? "==" : "<" ; | ||
System.out.println(output); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 두 정수 A 와 B가 주어졌을 때, A 와 B 를 비교하는 프로그램을 작성하시오. | ||
|
||
A, B = map(int, input().split()) | ||
|
||
if (A > B) : | ||
print(">") | ||
elif (A < B) : | ||
print("<") | ||
elif (A == B) : | ||
print("==") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.InputStreamReader; | ||
|
||
public class PROB14681 { | ||
// 점의 좌표를 입력받아 그 점이 어느 사분면에 속하는지 알아내는 프로그램을 작성하세요. | ||
public static void main(String[] args) throws Exception { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
|
||
int x = Integer.parseInt(br.readLine()); | ||
int y = Integer.parseInt(br.readLine()); | ||
|
||
System.out.println(((x > 0) && (y > 0)) ? "1" : ((x < 0) && (y > 0)) ? "2" : ((x < 0) && (y < 0)) ? "3" : "4" ); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 점의 좌표를 입력받아 그 점이 어느 사분면에 속하는지 알아내는 프로그램을 작성하세요. | ||
|
||
x = int(input()) | ||
y = int(input()) | ||
|
||
if (x > 0 and y > 0) : | ||
print("1") | ||
elif (x < 0 and y > 0) : | ||
print("2") | ||
elif (x < 0 and y < 0) : | ||
print("3") | ||
elif (x > 0 and y < 0) : | ||
print("4") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.util.StringTokenizer; | ||
|
||
public class PROB2480 { | ||
/* | ||
같은 눈이 3 개가 나오면 10000 + (같은 눈) * 1000 원의 상금을 받게 된다. | ||
같은 눈이 2 개가 나오면 1000 + (같은 눈) * 100 원의 상금을 받게 된다. | ||
모두 다른 눈이 나오는 경우에는 (그 중 가장 큰 눈) * 100 원의 상금을 받게 된다. | ||
*/ | ||
|
||
public static void main(String[] args) throws IOException { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
StringTokenizer st = new StringTokenizer(br.readLine()); | ||
|
||
int A = Integer.parseInt(st.nextToken()); | ||
int B = Integer.parseInt(st.nextToken()); | ||
int C = Integer.parseInt(st.nextToken()); | ||
|
||
int money = 0; | ||
int max = 0; | ||
|
||
if (A == B && B == C) { | ||
money = 10000 + A * 1000; | ||
|
||
} if (A == B && B != C) { | ||
money = 1000 + A * 100; | ||
|
||
} if (A != B && B != C) { | ||
max = Math.max(A, Math.max(B,C)); | ||
money = max * 100; | ||
} | ||
|
||
System.out.println(money); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 같은 눈이 3 개가 나오면 10000 + (같은 눈) * 1000 원의 상금을 받게 된다. | ||
# 같은 눈이 2 개가 나오면 1000 + (같은 눈) * 100 원의 상금을 받게 된다. | ||
# 모두 다른 눈이 나오는 경우에는 (그 중 가장 큰 눈) * 100 원의 상금을 받게 된다. | ||
|
||
A, B, C = map(int, input().split()) | ||
|
||
if A == B == C: | ||
print(10000+A*1000) | ||
elif A == B: | ||
print(1000+A*100) | ||
elif A == C: | ||
print(1000+A*100) | ||
elif B == C: | ||
print(1000+B*100) | ||
else: | ||
print(100 * max(A,B,C)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.util.StringTokenizer; | ||
|
||
public class PROB2525 { | ||
/* | ||
첫째 줄에는 현재 시각이 빈칸을 사이에 두고 주어진다. (24 시간제 이며, 23시 59 분에서 1 분이 지나면 0 시 0 분이 된다.) | ||
둘째 줄에는 요리 하는 데 필요한 시간 C 가 분 단위로 주어진다. | ||
*/ | ||
public static void main(String[] args) throws IOException { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
StringTokenizer st = new StringTokenizer(br.readLine(), " "); | ||
|
||
int A = Integer.parseInt(st.nextToken()); | ||
int B = Integer.parseInt(st.nextToken()); | ||
int C = Integer.parseInt(br.readLine()); | ||
|
||
int H = ((A*60) + B + C)/60; | ||
int M = ((A*60) + B + C)%60; | ||
|
||
if(H>23) { | ||
H -= 24; | ||
} | ||
|
||
System.out.println(H + " " + M); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 첫째 줄에는 현재 시각이 빈칸을 사이에 두고 주어진다. (24 시간제 이며, 23시 59 분에서 1 분이 지나면 0 시 0 분이 된다.) | ||
# 둘째 줄에는 요리 하는 데 필요한 시간 C 가 분 단위로 주어진다. | ||
|
||
A, B = map(int, input().split()) | ||
C = int(input()) | ||
|
||
H = ((A*60) + B + C)//60 | ||
M = ((A*60) + B + C)%60 | ||
|
||
if (H > 23) : | ||
H -= 24 | ||
|
||
print(H, M) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.InputStreamReader; | ||
|
||
public class PROB2753 { | ||
/* | ||
연도가 주어졌을 때, 윤년이면 1, 아니면 0 을 출력하는 프로그램을 작성하세요. | ||
윤년: 연도가 4의 배수이면서, 100의 배수가 아닐 때 또는 400의 배수일 때 | ||
*/ | ||
|
||
public static void main(String[] args) throws Exception { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
|
||
int year = Integer.parseInt(br.readLine()); | ||
|
||
System.out.println((((year % 4) == 0 && (year % 100) != 0) || year % 400 == 0) ? "1" : "0"); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 연도가 주어졌을 때, 윤년이면 1, 아니면 0 을 출력하는 프로그램을 작성하세요. | ||
# 윤년: 연도가 4의 배수이면서, 100의 배수가 아닐 때 또는 400의 배수일 때 | ||
|
||
year = int(input()) | ||
|
||
if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0 : | ||
print("1") | ||
else : | ||
print("0") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.util.StringTokenizer; | ||
|
||
public class PROB2884 { | ||
// 입력한 시간보다 45 분 앞서는 프로그램을 작성하세요. (단, 시간은 24 시간 표현을 사용하며, 하루의 시작은 0:0 이다.) | ||
public static void main(String[] args) throws IOException { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
StringTokenizer st = new StringTokenizer(br.readLine()); | ||
|
||
int H =Integer.parseInt(st.nextToken()); | ||
int M =Integer.parseInt(st.nextToken()); | ||
|
||
if(M <45) { | ||
H -= 1; | ||
M = 60 + (M - 45); | ||
|
||
if(H < 0) { | ||
H = 23; | ||
} | ||
} else { | ||
M -= 45; | ||
} | ||
|
||
System.out.println(H + " " + M); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 입력한 시간보다 45 분 앞서는 프로그램을 작성하세요. (단, 시간은 24 시간 표현을 사용하며, 하루의 시작은 0:0 이다.) | ||
|
||
H, M = map(int, input().split()) | ||
|
||
if (M < 45) : | ||
H -= 1 | ||
M = 60 + (M - 45) | ||
|
||
if (H < 0) : | ||
H = 23 | ||
|
||
else : | ||
M -= 45 | ||
|
||
print(H, M) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package baekjoon; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.InputStreamReader; | ||
|
||
public class PROB9498 { | ||
/* | ||
시험 점수를 입력받아 90~100 점은 A, 80~89 점은 B, 70~79 점은 C, 60~69 점은 D, | ||
나머지 점수는 F 를 출력하는 프로그램을 작성하시오. | ||
*/ | ||
|
||
public static void main(String[] args) throws Exception { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
|
||
int score = Integer.parseInt(br.readLine()); | ||
|
||
System.out.println((score >= 90) ? "A" : (score >= 80) ? "B" : (score >= 70) ? "C" : (score >= 60) ? "D" : "F"); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 시험 점수를 입력받아 90~100 점은 A, 80~89 점은 B, 70~79 점은 C, 60~69 점은 D, | ||
# 나머지 점수는 F 를 출력하는 프로그램을 작성하시오. | ||
|
||
score = int(input()) | ||
|
||
if (90 <= score <= 100) : | ||
print("A") | ||
elif (80 <= score < 90) : | ||
print("B") | ||
elif (70 <= score < 80) : | ||
print("C") | ||
elif (60 <= score < 70) : | ||
print("D") | ||
else : | ||
print("F") |