From 9362a19019f0491a936a23fecec37f7df0505378 Mon Sep 17 00:00:00 2001 From: suyeun84 <81475092+suyeun84@users.noreply.github.com> Date: Mon, 30 Jun 2025 23:26:36 +0900 Subject: [PATCH] =?UTF-8?q?Create=2030=20BOJ=20G4=20=EC=9D=8C=EC=8B=9D=20?= =?UTF-8?q?=ED=8F=89=EB=A1=A0=EA=B0=80.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5 \355\217\211\353\241\240\352\260\200.md" | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 "suyeun84/202506/30 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" 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); + } +} +```