题目:https://pintia.cn/problem-sets/994805260223102976/problems/1038429286185074688
代码
#include<cstdio>#include<algorithm>using namespace std;int m, x, y;void show(double unknown){if(m < unknown) printf(" Cong");if(m == unknown) printf(" Ping");if(m > unknown) printf(" Gai");}int main(){scanf("%d%d%d", &m, &x, &y);for(int i = 99; i >= 10; i--){int j = i % 10 * 10 + i / 10;double c = abs(i - j) * 1.0 / x ;if (j == y * c){printf("%d", i);show(i);show(j);show(c);return 0;}}printf("No Solution");return 0;}
