1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | using System; Console.WriteLine(NOD(36, 60)); Console.WriteLine(NOK2(36, 60)); static int NOK2( int a, int b) { return a * b / NOD(a, b); } static int NOD( int a, int b) { while (b != 0) { (a, b) = (b, a % b); } return a; } |