Matrix Trace
Computer Mathematics
Easy
2 views
Problem Description
Given n and an n x n matrix, print its trace.
Input Format
n then n lines.
Output Format
One integer trace.
Official Solution
Sum diagonal elements a[i][i].
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!