diff --git "a/0224LJH/202508/7 BOJ 4\354\231\200 7.md" "b/0224LJH/202508/7 BOJ 4\354\231\200 7.md" new file mode 100644 index 00000000..1a036c5c --- /dev/null +++ "b/0224LJH/202508/7 BOJ 4\354\231\200 7.md" @@ -0,0 +1,53 @@ +```java +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.*; + + +public class Main { + + static int target; + static List list = new ArrayList<>(); + + + public static void main(String[] args) throws IOException { + init(); + process(); + print(); + } + + private static void init() throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + target = Integer.parseInt(br.readLine()); + } + + private static void process() throws IOException { + + int pos = 1; + + while ( target > 0){ + int pre = 1 << (pos-1); + int cur = 1 << pos; + + if ( (target&pre) != 0){ + target -= pre; + list.add(4); + }else{ + target -= cur; + list.add(7); + } + pos++; + + + } + } + + + private static void print() { + for (int i = list.size()-1; i >= 0; i--){ + System.out.print(list.get(i)); + } + } +} +``` \ No newline at end of file