package 조건식;
import java.util.Scanner;
public class BOJ1330 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a,b;
a = scanner.nextInt();
b = scanner.nextInt();
if (a > b){
System.out.println(">");
} else if (a < b) {
System.out.println("<");
} else {
System.out.println("==");
}
}
}
package 조건식;
import java.util.Scanner;
public class BOJ9498 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int score = scanner.nextInt();
if (score >= 90){
System.out.println("A");
} else if (score >= 80) {
System.out.println("B");
} else if (score >= 70) {
System.out.println("C");
} else if (score >= 60) {
System.out.println("D");
} else {
System.out.println("F");
}
}
}
package 조건식;
import java.util.Scanner;
public class BOJ2753 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int year = scanner.nextInt();
if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
System.out.println(1);
} else {
System.out.println(0);
}
}
}
package 조건식;
import java.util.Scanner;
public class BOJ14681 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x = scanner.nextInt();
int y = scanner.nextInt();
int answer = 0;
if (x > 0 && y > 0){
answer = 1;
} else if (x < 0 && y > 0) {
answer = 2;
} else if (x < 0 && y < 0) {
answer = 3;
} else {
answer = 4;
}
System.out.println(answer);
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int h = scanner.nextInt();
int m = scanner.nextInt();
if (m - 45 < 0){
if (h == 0){
h = 23;
m += 60;
}else {
h--;
m += 60;
}
m -= 45;
} else{
m -= 45;
}
System.out.println(h + " " + m);
}
}
package 조건식;
import java.util.Scanner;
public class BOJ2525 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int h = scanner.nextInt();
int m = scanner.nextInt();
int m_ = scanner.nextInt();
int convertHour = (m + m_) / 60;
int convertMin = (m + m_) % 60;
if (h + convertHour > 23){
h = (h + convertHour) % 24;
} else {
h = h + convertHour;
}
m = convertMin;
System.out.println(h + " " + m);
}
}
주사위 상금 규칙
1.같은 눈이 3개가 나오면 10,000원+(같은 눈)×1,000원의 상금을 받게 된다.
2.같은 눈이 2개만 나오는 경우에는 1,000원+(같은 눈)×100원의 상금을 받게 된다.
3.모두 다른 눈이 나오는 경우에는 (그 중 가장 큰 눈)×100원의 상금을 받게 된다.
package 조건식;
import java.util.Scanner;
public class BOJ2480 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int max = 0;
int []dices = new int[3];
int answer = 0;
for(int i = 0; i<dices.length;i++){
dices[i] = scanner.nextInt();
if (max < dices[i]){
max = dices[i];
}
}
if (dices[0] == dices[1] && dices[1] == dices[2]) {
answer = 10000 + dices[0] * 1000;
} else if (dices[0] == dices[1]) {
answer = 1000 + dices[0] * 100;
} else if (dices[1] == dices[2]) {
answer = 1000 + dices[1] * 100;
} else if (dices[2] == dices[0]) {
answer = 1000 + dices[2] * 100;
} else if(dices[0] != dices[1] && dices[1] != dices[2] && dices[2] != dices[0]){
answer = 100 * max;
}
System.out.println(answer);
}
}