Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Task63
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine()); // Считываем число
- int[] array = new int[n]; // Создаем массив на N элементов
- string[] numbers = Console.ReadLine().Split(' '); // Делим входную строку по пробелу, записываем в массив
- for (int i = 0; i < n; i++) // В цикле парсим числа из массива строк в int и записываем в массив
- {
- array[i] = int.Parse(numbers[i]);
- if (i % 2 == 0) // Если индекс массива четный, то выводим этот элемент массива
- Console.Write($"{array[i]} ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement