|
|
back to boardhelp class Program { public static void Mod(int N, int M, int Y) { int f = 0, t = -1; for (int i = 0; i < M; i++) { int X = i; long y = X; for (int j = 2; j < N + 1; j++) { y = y * X; y = y % M; } if (y == Y) { if (f > 0) Console.Write($" "); Console.Write($"{X}"); f++; } } if (f == 0) Console.Write($"{t}"); Console.WriteLine(); } } Edited by author 17.09.2019 02:10 |
|
|