80求调
查看原帖
80求调
1000475
Zhang_Yi_Jian楼主2024/11/22 21:27
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int k;
    int ans;
    int sub1, sub2, sub3;
    cin >> k;
    for(int i = 10000; i <= 30000; i++)
    {
        sub1 = i / 100;
        sub2 = i % 10000 / 10;
        sub3 = i % 1000;
        if((sub1 % k == 0) && (sub2 % k == 0) && (sub3 % k == 0))
        {
            cout << i << endl;
            ans = 1;
        }
    }
    if(ans != 1)
    {
        cout << "No";  
    
    }
    return 0;
  
}
//大佬们帮忙看看是哪里出了问题
2024/11/22 21:27
加载中...