本题主要体会 return 0 在程序中的作用
#include<iostream>
#include<string>
using namespace std;
int x, y, m;
void Print(double t) {
if (m == t)
{
cout << " Ping";
}
else if (m > t)
{
cout << " Gai";
}
else
{
cout << " Cong";
}
}
int main()
{
cin >> m >> x >> y;
for (int i = 99; i >= 10; i--)
{
int j = i % 10 * 10 + i / 10;
double k = abs(j - i)*1.0 / x;
if (j==k*y)
{
cout << i;
Print(i);
Print(j);
Print(k);
return 0;
}
}
cout << "No Solution" << endl;
return 0;
}