높은곳에영광 2022. 1. 16. 23:35

class Solution {
public:
    int addDigits(int num) {
        return num != 0 && num % 9 == 0 ? 9 : num % 9;
    }
};