大佬们,为神马60分?

P1618 三连击(升级版)

孔丘 @ 2017-09-22 22:28:21

#include<iostream>
#include<cmath>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<string>
bool f (int n,int k,int s){
    if (k>9&&s==9) return 1;
    else if (k>9) return 0;
    for (int m=n;m;m/=10)
        if (m%10==k) {
            s++;
            break;
        }
    return f (n,++k,s);
}
using namespace std;
int main(){
    //freopen ("tree.in","r",stdin);
    //freopen ("tree.out","w",stdout);
    int a,b,c,x,y,z;
    cin>>a>>b>>c;
    for (x=102;x<=999/c*a;x++){
        if (x%a==0){
            y=x/a*b;
            z=x/a*c;
        }
        else continue;
        if (f (x*1000000+y*1000+z,1,0))
            printf ("%d %d %d\n",x,y,z);
    } 
    return 0;
}

by KesdiaelKen @ 2017-09-22 23:09:56

可能的输出“No”跑到哪里去了?@孔丘


by cszmc2004 @ 2017-10-06 18:18:18

@KesdiaelKen %%%


|