1 条题解

  • 0
    @ 2023-6-11 12:22:22

    C++ :

    #include<iostream>
    using namespace std;
    bool book[10001];
    int main() {
        int n;
        cin >> n;
        for (int  i = 1; i <= n; i++) {
            int tem = i;
            int num = i;
            while(tem) {
                num += tem % 10;
                tem = tem / 10;
            }
            book[num] = true;
        }
        for (int i = 1; i <= n; i++) {
            if(book[i] == false) {
                cout << i << endl;
            }
        }
        return 0;
    }
    
    
    • 1

    信息

    ID
    2724
    时间
    1000ms
    内存
    512MiB
    难度
    9
    标签
    递交数
    9
    已通过
    6
    上传者