
출처 : https://www.acmicpc.net/problem/2839 Problem Code package baek.bruteForce; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); // 3 , 5 int a = 3; int b = 5; int value = 0; if (N == 4 || N == 7) { value = -1; // 3 , 5로 나누어 떨어지지 않는 수 } else { int remainder = N % b; if (remainder == 0) { ..

출처 : https://www.acmicpc.net/problem/1436 Problem Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); int num = 666; int cnt = 1; while (cnt != N) { num++; if (String.valueOf(num).contains("666")) cnt++; } System.out.println(num); } } 순회하면서 666이 포함될때마다 카운트를 하도록 했습니다.

출처 : https://www.acmicpc.net/problem/19352 Problem Code import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); int x = 0, y = 0; int a = Integer.parseInt(st.nextToken()); int b = Intege..

출처 : https://www.acmicpc.net/problem/2231 Problem Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); int value = 0; for (int i = 0; i < N; i++) { int num = i; int sum = 0; while (num != 0) { sum += num % 10; // 각 자릿수 더하기 num /= 10; } if (sum + i == N) { value = i; break; } } System.out..

출처 : https://www.acmicpc.net/problem/2798 Problem Code package baek.bruteForce; import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); int maxValue = 0; int N = Integer.parseInt(st.nextToken()); int ..