Playground 172

[백준] 1110번

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); sc.close(); int count = 0; // 반복문 탈출하기 위한 변수 int domang = num; // 주어진 수가 10보다 작으면 앞에 0 붙여서 두 자리 수로 만들기 // 먼저 주어진 두 자리 수를 각각 더하기 // 주어진 수의 오른쪽 수와 앞에서 더해진 수의 오른쪽 수를 이어 붙이기 // 처음의 값이 나올 때 까지 반복하기 while (true) { num = ((num % 10) * 10) + ((num / 10) + (n..

[백준] 25304번

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //25304번 int totalPrice, count; totalPrice = sc.nextInt(); // 총 금액 count = sc.nextInt(); // 구매한 물건의 종류 수 int product[][] = new int[count][2]; // 이중배열 선언 int comp = 0; // 금액 비교 for (int i = 0; i < product.length; i++) { product[i][0] = sc.nextInt(); // 상품 가격 product[i][1] = ..