diff --git "a/suyeun84/202508/03 BOJ G5 4\354\231\200 7.md" "b/suyeun84/202508/03 BOJ G5 4\354\231\200 7.md" new file mode 100644 index 00000000..927877c6 --- /dev/null +++ "b/suyeun84/202508/03 BOJ G5 4\354\231\200 7.md" @@ -0,0 +1,30 @@ +```java +import java.io.*; +import java.util.*; + +public class boj2877 { + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static StringTokenizer st; + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + static StringBuilder sb = new StringBuilder(); + + public static void main(String[] args) throws Exception { + nextLine(); + int K = nextInt() + 1; + + int num = 0; + while(K != 0){ + num = K % 2; + sb.append(num); + K = K / 2; + } + StringBuilder result = new StringBuilder(); + for(int i = sb.toString().length() - 2; i >= 0; i--){ + if(sb.charAt(i) == '0') result.append(4); + else result.append(7); + } + System.out.println(result.toString()); + } +} +```