목록알고리즘 (29)
seong
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for(int i = 1; i
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for(int i = 1; i
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int sum = 0; if(a == b && b == c && a == c){ sum = 10000 + (a * 1000); } else if(a == b || a == c){ sum = 1000 + (a *100); } else if(b == c){ sum = 1000 + (b *100); } else{ //Math.max 는 기본적으로 두 인자만 비교가 되기 때문에..

풀이 시간이 24시간 이상을 넘어가면 0이 된다. 분 이 60분 이상이 되면 0 입력 받은 시간 / 60 을 시간에 더해준다(+) 60으로 나눈 나머지 값을 분에 더해준다(+) import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); // 시간 입력 0~23 int m = sc.nextInt(); // 분 입력 int c = sc.nextInt(); // 요리하는데 필요한 시간 입력 받기 h += c / 60; m += c % 60; if(m >= 60){ h+=1; m -= 60; } if(h >= 2..