1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课外】10.函数1/6-4 其右上三角(含主对角线)元素之和。.c

12 lines
176 B
C
Raw Permalink Normal View History

2024-11-20 03:07:17 +00:00
int fun(int a[3][3]) {
int res = 0;
for (int i = 0; i < 3; i++) {
for (int j = i; j < 3; j++) {
res += a[i][j];
}
}
return res;
}