[Algorithm] 백준 10250 ACM 호텔 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int x, y; // x : 엘리베이터로부터의 거리, y : 층 while(t > 0) { int h = sc.nextInt(); int w = sc.nextInt(); int n = sc.nextInt(); if(n % h == 0) { // h층에 배정될 경우 y = h; x = n / h; } else { y = n % h; x = n / h + 1; } System.out.println(y * 100 + x); // yyxx호 or yxx.. Algorithm/백준+프로그래머스+SWEA+정올+구름 4년 전
[Algorithm] 백준 2577 숫자의 개수 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 abc = a * b * c; int[] arr = new int[10]; while (abc != 0) { int rest = abc % 10; arr[rest]++; abc /= 10; } for (int i = 0; i < 10; i++) System.out.println(arr[i]); sc.close(); } } Algorithm/백준+프로그래머스+SWEA+정올+구름 4년 전
[Algorithm] 백준 2884 알람 시계 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int m = sc.nextInt(); if (m < 45) { if (h == 0) { h = 23; m += 15; } else { h -= 1; m += 15; } } else { m -= 45; } System.out.println(h + " " + m); sc.close(); } } Algorithm/백준+프로그래머스+SWEA+정올+구름 4년 전
[Algorithm] 백준 2753 윤년 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int year = sc.nextInt(); if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) System.out.println(1); else System.out.println(0); sc.close(); } } Algorithm/백준+프로그래머스+SWEA+정올+구름 4년 전
[Algorithm] 백준 10871 X 보다 작은 수 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); for(int i=0; i Algorithm/백준+프로그래머스+SWEA+정올+구름 4년 전
[Algorithm] 백준 2739 구구단 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i=1; i Algorithm/백준+프로그래머스+SWEA+정올+구름 4년 전