Skip to content

Commit cb4c222

Browse files
authored
Merge pull request #402 from AlgorithmWithGod/suyeun84
[20250630] BOJ / G4 / 음식 평론가 / 김수연
2 parents 2ef31e5 + 9362a19 commit cb4c222

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```java
2+
import java.io.*;
3+
import java.util.*;
4+
5+
public class boj1188 {
6+
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7+
static StringTokenizer st;
8+
static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());}
9+
static int nextInt() {return Integer.parseInt(st.nextToken());}
10+
11+
public static void main(String[] args) throws Exception {
12+
nextLine();
13+
int N = nextInt();
14+
int M = nextInt();
15+
16+
int div = M;
17+
while(div > 0) {
18+
int temp = N;
19+
N = div;
20+
div = temp % div;
21+
}
22+
System.out.println(M - N);
23+
}
24+
}
25+
```

0 commit comments

Comments
 (0)