编程介的小学生 2019-05-24 16:27 采纳率: 20.5%
浏览 234

连续的整数集合的累加处理的问题,怎么使用C程序的语言的编写代码的过程解答?

Problem Description
Write a program to determine the summation of several sets of integers.

Input
The input file will consist of up to 250 sets of integers, where each set contains at most 100 integers and the integer values will be between –16000 and + 16000. Each set of numbers is started with the number of integers in the set, n. The next n input lines will each contain one integer of the set. You should stop processing when the size of the set, n, is<= 0.

Output
A single line of output should be generated for each set of integers. The line should have format shown below.

Sample Input
4
-1
3
1
1
2
19
17
5
-645
952
-1488
-5456
-9342
-1

Sample Output
Sum of #1 is 4
Sum of #2 is 36
Sum of #3 is -15979

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站