Hong-Phuc Bui
2025-01-16 2889de7f0c2d587a17fbd322af57c29e84238620
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * euclidean-algorithm.js
 *
 */
 
import {terminal} from "./dfhi.js";
 
window.main = function(...argv) {
    let a = Number.parseInt(argv[0], 10);
    let b = Number.parseInt(argv[1], 10);
    let t = b;
    while (b!== 0) {
        t = b;
        b = a % b;
        a = t;
    }
 
    terminal.printl(a);
};