摘要: https://www.cnblogs.com/grandyang/p/4741934.html class Solution { public: bool isUgly(int num) { if(num<=0) return false; while(num%2==0) num/=2; whil 阅读全文
posted @ 2020-06-28 09:47 qiujiejie 阅读(110) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int addDigits(int num) { while(num>=10) { int sum=0; while(num) { sum+=num%10; num/=10; } num=sum; } return num; } }; 阅读全文
posted @ 2020-06-28 09:41 qiujiejie 阅读(136) 评论(0) 推荐(0) 编辑