06. Print Diagonals of Square Matrix - 80/100
Здравейте,
Моля някой да каже как е решил тази задача. На мен ми дава 80/100 с runtime error на последния тест, нищо че задачате е лесна и кратка.
Ето моя код: https://pastebin.com/rYZaZ0jE
Условието е:
Write a program that reads a matrix from the console. Then print the diagonals. The matrix will always be square. On the first line you read a single integer N the matrix size. Then on each line N elements. The first diagonal should always start with the element at the first row and col, the second diagonal should start with the element at the last row and first col.
Examples
Input | Output |
3 1 2 3 1 2 3 1 2 3 |
1 2 3 1 2 3 |
4 1 2 3 2 1 1 2 4 1 2 1 4 2 2 3 1 |
1 1 1 1 2 2 2 2 |
Благодаря ти, ъпсурд да се бях сетил за това :) Наистина си прав.