编程介的小学生 2019-08-16 22:00 采纳率: 20.5%
浏览 129

Add ‘em程序的设计问题

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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥15 stable diffusion
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿