C语言实验——求一个3*3矩阵对角线元素之和
Time Limit: 1000MS
Memory Limit: 65536KB
Problem Description
给定一个3*3的矩阵,请你求出对角线元素之和。
Input
按照行优先顺序输入一个3*3矩阵,每个矩阵元素均为整数。
Output
从左下角到右上角这条对角线上的元素之和
Example Input
1 2 3 1 2 3 1 2 3
Example Output
6
Hint
Author
#include <stdio.h>
int main (){
int i , j , s[101][101] , sum = 0;
for (i = 0 ; i < 3 ; i++)