一个C语言作业

来源:百度知道 编辑:UC知道 时间:2024/05/28 08:26:27
英文的,不好意思,劳驾各位大虾给看看吧。。。。呵呵,没分了,要是有的话就全送出去

As Manuel wants to get rich fast and without too much work, he decided to make a career in gambling. Initially, he plans to study the gains and losses of players, so that, he can identify patterns of consecutive wins and elaborate a win-win strategy. But Manuel, as smart as he thinks he is, does not know how to program computers. So he hired you to write programs that will assist him in elaborating his strategy.
Your first task is to write a program that identifies the maximum possible gain out of a sequence of bets. A bet is an amount of money and is either winning (and this is recorded as a positive value), or losing (and this is recorded as a negative value).
Input
The input set consists of a positive number N <= 10000 , that gives the length of the sequence, followed by N integers. Each bet is an integer greater than 0 and less than 1000.
The input is terminated with N = 0.
Output
For each given in

曼努埃尔想快速致富,没有太多的工作,他决定在赌博生涯。最初,他计划研究的成果和球员的损失,因此,他可以找出连胜模式和拟订一项双赢战略。但曼努埃尔,一样聪明,他认为他是,不知道如何程序的计算机。因此,他雇用了你写的程序,将协助他制定他的战略。
您的第一个任务是编写一个程序,确定出的最高的投注顺序可能获得的利润。阿投注是金钱,是可以赢得(这是一项积极的货值录),或失去(这是为负值记录)。
输入
输入集由正数N“= 10000,使该序列的长度,然后由N整数。每个投注是大于0的整数,小于1000。
输入终止与N = 0。
输出
对于每一个给定的输入设置,输出将回声与相应的解决方案路线。如果序列显示没有可能赢得的钱,那么输出的消息“连败。”
样本输入
5
12 -4 -10 4 9
3
-2 -1 -2
0
示例输出
最高是13连胜。
连败。
感谢
问题制定者:大卫德哈尔

去C语言贴吧 问问

你们老师搞ACM的啊 出这样的题!