标签:public scan family port hdu can ati print string
import java.util.*;
class Main{
public static void main(String args[])
{
Scanner scanner=new Scanner(System.in);
int C=scanner.nextInt();
while(C--!=0)
{
int N=scanner.nextInt();
int [][]tower=new int[N][N];
for(int i=0;i<N;i++)
for(int j=0;j<=i;j++)
tower[i][j]=scanner.nextInt();
for(int i=N-2;i>=0;i--)
for(int j=0;j<=i;j++)
tower[i][j]+=Math.max(tower[i+1][j],tower[i+1][j+1]);
System.out.println(tower[0][0]);
}
}
}
标签:public scan family port hdu can ati print string
原文地址:http://www.cnblogs.com/zjnu/p/7352112.html