static void Main(string[] args) { long b = 0; for (int n = 1; n <= 10;n++ ) { long a = 1; for (int j = 1; j <= n;j++ ) { a = a * j; } b += a; } Console.Write(b); Console.ReadKey(); }
static void Main(string[] args) { int[] array = new int[10]; int sum = 0; array[0] = 1; for (int i = 1; i < 10;i++ ) { array[i] = array[i - 1] * (i + 1); sum += array[i]; } Console.Write(sum + array[0]); Console.ReadKey(); }