using System; public class Test { public static void Main() { int d = 0, t = 0, s; for (int i = 0; i < 10; i++) for (int j = i; j < 10; j++) for (int l = j; l < 10; l++) { s = i + j + l - 13; if (s > 0) break; if (s < 0) { l -= s + 1; continue; } if (i == j || j == l) d++; else t++; } var k = d*3 + t*6; Console.WriteLine("кол-во комбинаций: " + k*k); } }