Курс языка программирования Raku / Основы / Больше о типах / Позиционные типы данных / Exercises

Нечетные индексы

Problem

You have a array of numbers:

my @data = 10, 12, 1, 5, -9, 8, 36, 18, 21;

Complete the program to print only the elements with odd indices. Make sure the program still works if you change the number of items in @data.

Example

$ raku odd-indices.raku
12
5
8
18

Solution

See the solution

Навигация по курсу

Решение: Названия месяцев   |   Решение: Нечетные индексы