1 条题解

  • 1
    @ 2025-12-16 21:52:11

    简单死了

    #include<bits/stdc++.h>
    using namespace std;
    int main() {
        int n, sum = 0;
        cin >> n;
        for (int i = 1; i <= n; i++) {
            int j = i;
            while (j > 0) {
                if (j % 10 == 1) sum++;
                j /= 10;
            }
        }
        cout << sum;
        return 0;
    }
    
    
    
    • 1

    信息

    ID
    99
    时间
    1000ms
    内存
    256MiB
    难度
    3
    标签
    递交数
    109
    已通过
    61
    上传者