Hong-Phuc Bui
2025-10-17 0079221776106e3ca91076938e80d37e38eacc29
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 = (...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);
};