We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fec3bf commit b92e120Copy full SHA for b92e120
1 file changed
JHLEE325/202603/21 BOJ G5 4와 7.md
@@ -0,0 +1,25 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+public class Main {
6
7
+ public static void main(String[] args) throws Exception {
8
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
9
+ int K = Integer.parseInt(br.readLine());
10
11
+ String binary = Integer.toBinaryString(K + 1);
12
13
+ StringBuilder sb = new StringBuilder();
14
+ for (int i = 1; i < binary.length(); i++) {
15
+ if (binary.charAt(i) == '0') {
16
+ sb.append('4');
17
+ } else {
18
+ sb.append('7');
19
+ }
20
21
22
+ System.out.println(sb.toString());
23
24
+}
25
+```
0 commit comments