Skip to content

Commit b92e120

Browse files
authored
[20260321] BOJ / G5 / 4와 7 / 이준희
1 parent 1fec3bf commit b92e120

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)