From 00e9fc3827566c76a3e2f88bba53b971615bc286 Mon Sep 17 00:00:00 2001 From: llIllIllIllIllIllIllIllI <_@seol.pro> Date: Sat, 13 Dec 2025 23:52:19 +0900 Subject: [PATCH] =?UTF-8?q?[20251213]=20BOJ=20/=20G5=20/=204=EC=99=80=207?= =?UTF-8?q?=20/=20=EC=84=A4=EC=A7=84=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Seol-JY/202512/13 BOJ G5 4\354\231\200 7.md" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "Seol-JY/202512/13 BOJ G5 4\354\231\200 7.md" diff --git "a/Seol-JY/202512/13 BOJ G5 4\354\231\200 7.md" "b/Seol-JY/202512/13 BOJ G5 4\354\231\200 7.md" new file mode 100644 index 00000000..d544b00a --- /dev/null +++ "b/Seol-JY/202512/13 BOJ G5 4\354\231\200 7.md" @@ -0,0 +1,24 @@ +```java +import java.io.*; + +public class Main { + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + long k = Long.parseLong(br.readLine().trim()); + + long n = k + 1; + + StringBuilder sb = new StringBuilder(); + while (n > 1) { + if (n % 2 == 0) { + sb.append('4'); + } else { + sb.append('7'); + } + n /= 2; + } + + System.out.println(sb.reverse().toString()); + } +} +```