Matrix Trace

Computer Mathematics Easy 2 views
Back to Questions
Previous 2x2 Determinant Easy P

Problem Description

Given n and an n x n matrix, print its trace.

Input Format

n then n lines.

Output Format

One integer trace.

Sample Test Case

Input:
2 1 2 3 4
Output:
5

Constraints

n

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev