#include <iostream> #include <cmath> using namespace std; int n, x, y; // 这样就可以很灵活 void print(double t) { if (n == t) cout << " Ping"; else if (n < t) cout << " Cong"; else cout << " Gai"; } int main() { cin >> n >> x >> y; for (int a = 99; a >= 10; a--) { int b = a % 10 * 10 + a / 10; double c = abs(a - b) * 1.0 / x; // 因为c可能会出现浮点数的情况 if (b == c * y) { cout << a; print(a); print(b); print(c); return 0; // 结束很关键 } } cout << "No Solution"; // 很巧妙 return 0; }