| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 562 人关注过本帖
标题:令我郁闷的一道题
取消只看楼主 加入收藏
长安之星
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-10-27
收藏
 问题点数:0 回复次数:0 
令我郁闷的一道题

编程爱好者acm的一个题目:
Number Triangle
Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be 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.如输入
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
结果为30
说明:从第一行开始,加上下一行与他相邻的数(选一个),输出最后得出的和最大的情况。
如上面的列子:结果为7+3+8+7+5=30。
实在想不出来了才想到你们,,哎~~~
祝论坛越来越好~~~~~


搜索更多相关主题的帖子: 编程 triangle highest numbers 
2006-11-11 19:34
快速回复:令我郁闷的一道题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011342 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved