Half-degrees of vertices#3985

Half-degrees of vertices

1 sekunda
64 megabajty
Bardzo łatwe

You are given a directed graph represented by an adjacency matrix. Your task is to determine the in-degree and out-degree for each vertex in the graph. The in-degree is the number of edges coming into a vertex, while the out-degree is the number of edges going out from a vertex.

Dane wejściowe

— the number of vertices in the graph (1 \leq N \leq 100), followed by an adjacency matrix consisting of rows, each containing numbers, where each number is either or .

Dane wyjściowe

For each vertex, output a pair of numbers: the in-degree followed by the out-degree. Provide these pairs for all vertices.

Przykłady

Przykład 1

Loading
Loading