Skip to content

Latest commit

 

History

History
8 lines (8 loc) · 215 Bytes

258.md

File metadata and controls

8 lines (8 loc) · 215 Bytes

#258. Add Digits 题目链接

int addDigits(int num) {
    // 数学方法,数字的每位相加等于模9的结果
    return num<10?num:(num%9==0?9:num%9);
}