60、各位相加

题目描述 PS:你可以不使用循环或者递归,且在 O(1) 时间复杂度内解决这个问题吗? 不看PS的要求: 直接撸出代码: class Solution { public int addDigits(int num) { int x = 0; while (true) { x = 0; while (num > 0) { x += num%10;
相关文章
相关标签/搜索