2x+xy+x/y=243求正整数解代码
using System;namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
for (double x = 0; x <= 65532; x++)
{
for (double y = 1; y <= 65532; y++)
{
double r = 2.0 * x + x * y + x / y*1.0;
if (r == 243)
{
Console.WriteLine("x=" + x + ",y=" + y + "=243");
}
}
}
Console.ReadLine();
}
}
}
结果为:
Hello World!
x=24,y=8 =>243
x=54,y=2 =>243
页:
[1]