CEN254 PRE1B |
Старт: 04.апр.2017 в 13:18:00
Финиш: 04.апр.2017 в 14:25:00
Турнир завершён!
• Турнирная таблица
|
|
Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Reflect a matrix
Question:
For a course you are required to reflect the given
matrix in the given dimension. There is Horizontal (H)
and Vertical (V). Write a program that
reads a 2D array and the dimension to reflect, then
show the new array.
Input specification:
Firstly, you will be given two integers (r and c)
size of 2D array. Then, you will be given c integers
in the following n lines.On the next line,
you will be given an integer k; then k chars (V or H)
where 1 ≤ (r and c) ≤ 100; 1 ≤ k ≤ 200;
numbers in the matrix are less 1001.
Output specification:
Show the first line of reflected matrix.
Sample Input |
Sample Output |
5 3
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
2
H V
|
15 14 13
|
Explanation:
Given array has been first horizontally reflected,
then vertically reflected.
Для отправки решений необходимо выполнить вход.
|