diff --git "a/suyeun84/202506/30 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" "b/suyeun84/202506/30 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" new file mode 100644 index 00000000..125b6bc3 --- /dev/null +++ "b/suyeun84/202506/30 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" @@ -0,0 +1,25 @@ +```java +import java.io.*; +import java.util.*; + +public class boj1188 { + 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());} + + public static void main(String[] args) throws Exception { + nextLine(); + int N = nextInt(); + int M = nextInt(); + + int div = M; + while(div > 0) { + int temp = N; + N = div; + div = temp % div; + } + System.out.println(M - N); + } +} +```