using System; class Program { static void Main() { Console.WriteLine("=== Блок 1 (варіант 13) ==="); DoBlock_1(); Console.WriteLine(); Console.WriteLine("=== Блок 2 (варіант 32) ==="); DoBlock_2(); Console.WriteLine(); Console.WriteLine("=== Блок 3 (варіант 36) ==="); DoBlock_3(); } static void DoBlock_1() { Console.WriteLine("Введіть кількість елементів n:"); int n = int.Parse(Console.ReadLine()); int count = 0; for (int i = 1; i <= n; i++) { Console.WriteLine("Введіть елемент №{0}:", i); int x = int.Parse(Console.ReadLine()); if (x % 2 == 0) count++; } Console.WriteLine("Кількість парних елементів: {0}", count); } static void DoBlock_2() { Console.WriteLine("Вводьте числа послідовності, закінчіть нулем:"); int first = int.Parse(Console.ReadLine()); if (first == 0) { Console.WriteLine("Послідовність порожня."); return; } int count = 1; // перший елемент кратний сам собі int x = int.Parse(Console.ReadLine()); while (x != 0) { if ((long)x % first == 0) count++; x = int.Parse(Console.ReadLine()); } Console.WriteLine("Кількість елементів, кратних першому ({0}): {1}", first, count); } static void DoBlock_3() { Console.WriteLine("Введіть кількість доданків n:"); int n = int.Parse(Console.ReadLine()); if (n < 1) { Console.WriteLine("n має бути не меншим за 1."); return; } long sum = 0; long term = 1; int k = 0; do { sum += term; term += 2; k++; } while (k < n); Console.WriteLine("S = {0}", sum); } }