index | submit | rank | book

repeat-list – Repeat-a-list

Write a program that reads lists of integers from standard input and replicates the same integers on standard output.

Input and Output

Each line of input begins with a number L, indicating the number of integers to be repeated, followed by L numbers all separated by a single space.

For each line of input there should be a line of output with the number of integers followed by elements: followed by the numbers given in the input. Output values should not contain leading zeroes and should be separated by a single space.

Each list has at least one element and at most a hundred elements, i.e., 1 ≤ L ≤ 100.

Example Input

4 1 2 3 4
2 32 16
3 12 360 60

Example Output

4 elements: 1 2 3 4
2 elements: 32 16
3 elements: 12 360 60

Scoring

try first: repeat swap

try next: index-ints

index | submit | rank | book

Copyright © 2020-2021 Rudy Matela
All rights reserved