1088 三人行

void pprint(double wo,double jia){
    if(jia > wo) cout<<"Cong";
    else if(jia == wo) cout<<"Ping";
    else if(jia < wo) cout<<"Gai";
}
int main()
{
    //freopen("D:\\文件夹\\Desktop\\use.txt","r",stdin);
    int M,X,Y;scanf("%d %d %d",&M,&X,&Y);getchar();
    
    int a,b;//甲ab
    int jia = 0;
    for(a = 9;a>=1;--a){
        for(b = 9;b>=0;--b){
            if (     ((abs((a*10+b) - (b*10+a))) * Y) == ((b*10+a) * X )  )  {jia = a*10+b;goto label;}
        }
    }
label:if(jia == 0) cout<<"No Solution";
      else{
          cout<

有关测试点4:

你可能感兴趣的:(1088 三人行)