Open jwenjian opened 4 years ago
Card 判断1/n是否为无限小数__张洪基-CSDN博客 added the to the Python list in the 遇见 board at June 5, 2020 at 05:05PM > 原理: 只要被除数n可以转化为2的次幂或者转化为2与5的组合 即为有限小数 否则无限小数 bool iint(int n) { if(n==1) return false; else if(n%2==0) { return iint(n/2); } else if(n%5==0) { return iint(n/5); } else return true; } --- View on Trello
June 5, 2020 at 05:05PM
Card 判断1/n是否为无限小数__张洪基-CSDN博客 added the to the Python list in the 遇见 board at
June 5, 2020 at 05:05PM
> 原理: 只要被除数n可以转化为2的次幂或者转化为2与5的组合 即为有限小数 否则无限小数 bool iint(int n) { if(n==1) return false; else if(n%2==0) { return iint(n/2); } else if(n%5==0) { return iint(n/5); } else return true; }
---
View on Trello