|
|
back to boardWhat is wrong here?С# using System; class Entrypiont { static void Main() { string[] Input = Console.ReadLine().Split(' '); int a = Convert.ToInt32(Input[0]); int b = Convert.ToInt32(Input[1]); int c = Convert.ToInt32(Input[2]); if(((c-1)%a)==((c-1)%b) && ((c - 1) % a) == 0) { int x=1, y=1, z=1; while (true) { if(Math.Pow(x,a)+ Math.Pow(y, b)== Math.Pow(z, c)) { Console.Write(x); Console.Write(y); Console.Write(z); break; } else { if(Math.Pow(x, a) + Math.Pow(y, b) >Math.Pow(z, c)) { z++; } else { if (x >= y) { y++; } else { x++; }
} } } } Console.ReadLine(); } } |
|
|