| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 9841 人关注过本帖
标题: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
快速回复:1加到n,怎么做???
数据加载中...
 
   



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

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