国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

The Triangle

2019-11-14 10:21:22
字體:
供稿:網(wǎng)友

The Triangle

時間限制:1000 ms  |  內(nèi)存限制:65535 KB難度:4描述

73 88 1 02 7 4 44 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.

輸入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.輸出Your program is to write to standard output. The highest sum is written as an integer.樣例輸入
573 88 1 0 2 7 4 44 5 2 6 5樣例輸出
30


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 民和| 湾仔区| 高青县| 沁源县| 雷山县| 永清县| 图片| 色达县| 郎溪县| 英吉沙县| 左贡县| 铜山县| 庄河市| 德清县| 甘南县| 霍州市| 琼结县| 射洪县| 雅安市| 正阳县| 长海县| 龙井市| 鸡泽县| 湖南省| 英吉沙县| 阳西县| 高邮市| 师宗县| 沭阳县| 乐昌市| 仲巴县| 扎兰屯市| 株洲市| 登封市| 冷水江市| 津市市| 延庆县| 娄烦县| 甘洛县| 穆棱市| 汶川县|