1 条题解

  • 0
    @ 2024-8-2 16:19:43

    C++ :

    #include<bits/stdc++.h>
    
    using namespace std;
    int a[10010];
    int n;
    int main() {
        cin >> n;
        for (int i = 1; i <= n; i++) cin >> a[i];
        sort(a + 1, a + n + 1);
        for (int i = 1; i <= n; i++) {
            int t = a[i], c = 0;
            while (t != 0) {
                if (t % 10 % 3 == 0) {
                    c++;
                    
                }
                
                t /= 10;
            }
            if (c % 2 == 0) {
                cout << a[i] << endl;
            }
        }
        return 0;
    }
    
    • 1

    信息

    ID
    975
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    3
    已通过
    3
    上传者