🟡 Վարժություն 18
Գրել ծրագիր, որն էկրանին տպում է մուտքագրված մատրիցը սպիռալաձև։
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F70b0015f-1c10-4986-b769-cc6b16691a28%2FUntitled.png?table=block&id=72ce1203-ba00-4ee1-9dc5-76685b7fac9a&cache=v2)
Օրինակ՝
Մուտք՝
1 2 3 4
5 6 7 8
9 10 11 12
12 14 15 16
Ելք՝
1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10
#include <iostream>
int main() {
constexpr int rowsCount = 4, columnsCount = 4;
int matrix[rowsCount][columnsCount];
// Put your code to insert matrix elements
// Put your code to print matrix in spiral form
}
Constraints
Time limit: 0.2 seconds
Memory limit: 512 MB
Output limit: 1 MB