ACM里边一道halloween分糖果问题中的一句话

来源:百度知道 编辑:UC知道 时间:2024/05/16 12:07:52
Input

The input contains several test cases.
The first line of each test case contains two integers c and n (1 ≤ c ≤ n ≤ 100000), the number of

children and the number of neighbours, respectively. The next line contains n space separated integers

a1 , ... , an (1 ≤ ai ≤ 100000 ), where ai represents the number of sweets the children get if they

visit neighbour i.

The last test case is followed by two zeros.

最后那句 The last test case is followed by two zeros. 什么意思,没弄明白。。。
别说网上翻译哈,翻译出来牛头不对马嘴 。
希望各位能针对这道题来说说它的意思哈,直译的话 这句话 太简单了。

如能回答,追加30积分! 不差钱~~~

输入包含多个测试案例
每个案例包含两行
第一行是两个整数c和n,它们的关系是(1 ≤ c ≤ n ≤ 100000),分别表示孩子和邻居数。
第二行是n个空格分开的整数,分别是a1 , ... , an,ai表示如果孩子们访问邻居i获得的糖果数。
案例以0 0结束。

就是最后一个输入后用0 0来标志
和题目没关,这是一开始没有输入case个数的题目通用方法
一般用
while (cin>>c>>n&&!(n==0&&c==0))
{
}
来作为外部框架