Run ID:93551
提交时间:2024-10-17 20:56:58
#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 */