作业帮 > 英语 > 作业

英语翻译Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Fig

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/05/14 09:54:20
英语翻译
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
英语翻译Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Fig
描述
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
说明:这似乎是英文版的编程题目,由于不知道笔者的编程类型是什么,所以只能字面翻译,有些专业术语无法使用,看上去像数据结构之类的.我只能翻译到这个程度了,希望可以帮助你,