标题:1加到n,怎么做???
取消只看楼主
tobyzhao
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-3-8
 问题点数:0 回复次数:0 
1加到n,怎么做???
In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n
The input will consist of a series of integers n, one integer per line。。
For each case, output SUM(n) in one line, followed by a blank line. You may assume the result will be in the range of 32-bit signed integer。。。。
Sample Input
1
100
Sample Output
1

5050
搜索更多相关主题的帖子: line SUM integer Sample The 
2008-03-08 11:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-202487-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.236732 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved