Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93551 胡海峰老师 C语言7.10 C Accepted 0 MS 200 KB 283 2024-10-17 20:56:58

Tests(1/1):


Code:

#include <stdio.h> main() { int n,res=0,tmp; scanf("%d",&n); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { scanf("%d",&tmp); if(i==j) res += tmp; } printf("%d ",res); return 0; } /* 3 3 6 8 10 2 3 7 1 9 Output 14 */