PROGRAMMING:Digital triangle
Given a number triangle composed of N rows of numbers, as shown in the figure below. Try to design an algorithm to calculate from the triangle
A path from the top to the bottom of the path (each step can be down along the left slash or right slash) to maximize the sum of the numbers that the path passes through.
![ QQ screenshot 20170929023616. JPG] (~ / 12cebf3a-be34-457d-a3d3-9153ccd29ff0. JPG)
###Input format:
Input has n + 1 lines:
The first line is the number of lines of the number triangle n, 1 < = n < = 100.
The next n rows are the numbers in each row of the number triangle. All numbers are between 0.. 99.
###Output format:
Output the value of the maximum path.
###Input example:
Here is a set of inputs. For example:
```in
five
seven
3 8
8 1 0
2 7 4 4
4 5 2 6 5
```
###Output example:
The corresponding output is given here. For example:
```out
thirty
```
answer:If there is no answer, please comment
A path from the top to the bottom of the path (each step can be down along the left slash or right slash) to maximize the sum of the numbers that the path passes through.
![ QQ screenshot 20170929023616. JPG] (~ / 12cebf3a-be34-457d-a3d3-9153ccd29ff0. JPG)
###Input format:
Input has n + 1 lines:
The first line is the number of lines of the number triangle n, 1 < = n < = 100.
The next n rows are the numbers in each row of the number triangle. All numbers are between 0.. 99.
###Output format:
Output the value of the maximum path.
###Input example:
Here is a set of inputs. For example:
```in
five
seven
3 8
8 1 0
2 7 4 4
4 5 2 6 5
```
###Output example:
The corresponding output is given here. For example:
```out
thirty
```
answer:If there is no answer, please comment