P2841求助
查看原帖
P2841求助
225837
jimmyshi29楼主2020/8/20 20:54
# include <iostream>
using namespace std;

bool chk(int x)
{
    while (x != 0)
    {
        if (x % 10 != 0 || x % 10 != 1)
            return false;
        x /= 10;
    }
    return true;
}

int main()
{
    int a;
    cin >> a;
    for (int b = 1; b <= 10000; b++)
    {
        if (chk(a * b))
        {
            cout << b << endl;
            break;
        }
    }
    return 0;
}

本地测试没输出,0分

2020/8/20 20:54
加载中...