求指教,请各位看看这道题,在国外孤立无援。
Question: generate two different random integers, s and t, which are different for each message. s is called the start code and t is called the end code.
The value of t is transmitted as the first integer in the encoded output. Then for every integer i in the message, the integer s is sent followed by a
randomly generated sequence L of 1 or more integers that sum to i with the constraint that neither s nor t appears in the sequence.
The entire message is terminated by a single t value. For example, if the message is 3, 21, 5 and the start and end codes are 11 and -91, the message might be transmitted as -91, 11, -1, 5, 2, -3, 11, 21, 11, 4, 0, 1 , -91 (where 3 is represented as -1 + 5 + 2 - 3, 21 is represented as itself and 5 is represented as 4 + 0 + 1).
Non-functional requirements: your program may not use arrays!
Input
-91 11 -1 5 2 -3 11 21 11 4 0 1 -91
Output
3
21
5
Input
0 1 2 3 4 1 -1 -2 -3 0
output
9
-6
拜托各位帮帮忙吧,我人在澳洲,刚到这边,没几个会编程的朋友,大部分都是学商科的,这个是学校的作业,我实在是不太明白怎么做。只能求教于网络了。拜托大家