c语言的循环结束
来源:百度知道 编辑:UC知道 时间:2024/06/19 23:38:34
Description
Your task is to calculate the sum of some integers.
Input
Input contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.
Output
For each test case you should output the sum of N integers in one line, and with one line of output for each line in input.
Sample Input
4 1 2 3 4
5 1 2 3 4 5
Sample Output
10
15
怎么让它结束?
Your task is to calculate the sum of some integers.
Input
Input contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.
Output
For each test case you should output the sum of N integers in one line, and with one line of output for each line in input.
Sample Input
4 1 2 3 4
5 1 2 3 4 5
Sample Output
10
15
怎么让它结束?
你是说输入的整形数的循环,如何结束么?
既然输入了数组长度,分别为4和5,那么用4和5作为循环次数,循环就可以结束了,不知道我说的是不是你想要表达的意思。