20分
查看原帖
20分
1320218
yangyongtao楼主2024/10/7 20:48
#include <bits/stdc++.h>
using namespace std;
int main(){
    int k;
    cin >> k;
    bool s = 1;
    for (int i = 10000;i <= 30000;i ++){
        int a = i % 1000,b = i % 10000 / 100,c = i / 10000;
        if (a % k == 0 and b % k == 0 and c % k == 0){
            s = 0;
            cout << i << ' ';
        }
    }
    if (s == 1)cout << "No";
    return 0;
}
2024/10/7 20:48
加载中...