一个数除以9余8除以8余7除以7余6

 1 /**
 2  * 一个数,除以9余8
 3  * 除以8余7
 4  * 除以7余6
 5  * 请求得这个数的最小公约数
 6  * js代码写法
 7  */
 8 
 9 cc.Class({
10     extends: cc.Component,
11 
12     properties: {
13     },
14 
15     onLoad () {
16         this.init();
17     },
18 
19     init() {
20         let index = 0;
21         let judge = true;
22 
23         while(judge) {
24             index++;
25             if (index % 9 == 8 && index % 8 == 7 && index % 7 == 6) {
26                 this.order(index);
27                 judge = false;
28             }
29         };
30 
31     },
32 
33     order(num) {
34         console.log("最小公约数为: ", num);
35     },
36 
37 });
原文地址:https://www.cnblogs.com/Hunter-541695/p/14934242.html