计算机,紧急求救,紧急紧急,有谁能粗略翻译一下以下文字

来源:百度知道 编辑:UC知道 时间:2024/06/18 01:45:06
Description

7
3 8
8 1 0
2 7 4 4
4 5 2 6 5

(Figure 1)

Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right.

Input

Your program is to read from standard input. The first line contains one integer N: the number of rows in the triangle. The following N lines describe the data of the triangle. The number of rows in the triangle is > 1 but <= 100. The numbers in the triangle, all integers, are between 0 and 99.

Output

Your program is to write to standard output. The highest sum is written as an integer.

Sample Input

5
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5

Sample Output

30

描述

7
3 8
8 1 0
2 7 4 4
4 5 2 6 5

(数据1)

数据1是一个数字三角,请编写一个程序,使其按要求从最上面的数字加起,算到符合条件的最大值停止,每一步都需要根据条件判断出是向左还是向右继续累加

输入

你的程序系统首先要接受所输入的数据.第一行要包含一个整数N,且必须来自那个数字三角.这个整数N的描述源于那个三角.三角内每一行的数字都要大于1,小于等于100.而所有的整数N都要在0到99之间

输出

你的程序系统要写入(储存)输出字符,最大的那个总数要按照整数形式输出

输入示例
5
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5

输出示例

30

说明:这似乎是英文版的编程题目,由于不知道笔者的编程类型是什么,所以只能字面翻译,有些专业术语无法使用,看上去像数据结构之类的.我只能翻译到这个程度了,希望可以帮助你,呵呵

给出:
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
[数据1]

数据1是一个数字三角。请编写一个程序来计算符合规则的结果中最大的一个。规则:从数字三角的第一行数字开始同该数字下行中左下或者右下的数字相加,依次类推,直到加到最后一行的某个数字结束,得出和。

要求:
输入

程序从标准输入中开始读取数据。第一行包含一个整数N,每一行的数字个数与该行行数相同,组成了数字三角。数字三角的行数>1且<=100;数字三角中的所有整数必须大于等于0小于等于99。

输出

程序以整数形式将计算出的最大的结果储存。

举例:

输入

5
7