缘由关于#c++#的问题:这个应该按照怎么个思路来写:想老半天莫得思路想法-编程语言-CSDN问答
void 两数相互求余等于输入两数()
{//缘由https://ask.csdn.net/questions/7813625
int a = 0, b = 0, x = 0, y = 0;
cin >> a >> b;
if (a > b)
x = a, y = a + b;
else
x = a + b, y = b;
if (x%y == a&&y%x == b)
cout << x%y << "=" << a << " " << y%x << "=" << b << "\n";
else
cout << "-1 -1\n";
}
void 两数相互求余等于输入两数()
{//缘由https://ask.csdn.net/questions/7813625
int a = 0, b = 0, x = 0, y = 0;
while (++a < 100)
{
while (++b < 100)
{
if (a > b)
x = a, y = a + b;
else
x = a + b, y = b;
if (x%y == a&&y%x == b)
cout << x << "|" << y << " " << a << "|" << b << "\t";
else
cout << x << "|" << y << "-1 -1\t";
}
b = 0;
}
}