1. 2525번: 오븐 시계
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
scanner.close();
int time = (a*60)+b+c;
int hour = time/60;
if(hour >= 24) {
hour= hour-24;
}
System.out.println(hour + " "+ (time %60));
}
}
2. 10757번: 큰 수 A+B
import java.util.Scanner;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
BigInteger a = scanner.nextBigInteger();
BigInteger b = scanner.nextBigInteger();
scanner.close();
System.out.print(a.add(b));
}
}
'공부기록 > 백준' 카테고리의 다른 글
[백준] 2439번 별찍기 -2 (0) | 2023.02.25 |
---|---|
[백준] 10807번 개수세기, 10871번 X보다 작은 수, 10818번 최소, 최대, 10699번 오늘 날짜 (0) | 2023.02.12 |
[백준] 10952번: A+B-5, 10950번: A+B-3, 11021번: A+B-7, 2884번 알람 시계 (0) | 2023.01.31 |
[백준] 25304번 영수증, 10951번 A+B-4, 10870번 피보나치 수 5 (0) | 2023.01.31 |
[백준] 3753번 윤년, 10872번 팩토리얼 (0) | 2023.01.31 |