标签:namespace des return ++ nbsp sample int 输入 --
http://acm.hdu.edu.cn/showproblem.php?pid=2084

代码:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[101][101];
int main() {
int T;
scanf("%d", &T);
for(int i = 1; i <= T; i ++) {
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i ++) {
for(int j = 1; j <= i; j ++)
scanf("%d", &a[i][j]);
}
for(int i = n; i >= 2; i --) {
for(int j = 1; j <= i; j ++)
a[i - 1][j]+=max(a[i][j], a[i][j + 1]);
}
printf("%d\n", a[1][1]);
}
return 0;
}
标签:namespace des return ++ nbsp sample int 输入 --
原文地址:https://www.cnblogs.com/zlrrrr/p/9380159.html