1100 -- 连续和
2015-08-30 10:11
316 查看
连续和
Time Limit:1000MS Memory Limit:65536K
Total Submit:964 Accepted:260
Description
输入正整数n(n不超过1000000)输出1+2+3+...+n的值。
Input
一个正整数n
Output
输出1+2+3+...+n的值。
Sample Input
Sample Output
Source
lrj程序入门
Time Limit:1000MS Memory Limit:65536K
Total Submit:964 Accepted:260
Description
输入正整数n(n不超过1000000)输出1+2+3+...+n的值。
Input
一个正整数n
Output
输出1+2+3+...+n的值。
Sample Input
100
Sample Output
5050
Source
lrj程序入门
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AK1100 { class Program { static void Main(string[] args) { long n = Convert.ToInt64(Console.ReadLine()); long sum = (1 + n) * n / 2; Console.WriteLine("{0}", sum); } } }
相关文章推荐
- adbd cannot run as root in production builds
- surfaceview
- ZY-2015-08-27
- leetcode Course Schedule
- myeclipse一些智能提示修改
- SelectToy(容斥)
- C++中vector使用
- FreeMarker四种变量的用法
- vmware虚拟机配置
- 我的openwrt学习笔记(十八):linux便捷开发命令之alias
- JavaScript检测实例属性, 原型属性
- CodeForces 574B-Bear and Three Musketeers
- java写的九九乘法表
- 1096. Consecutive Factors
- 获取单个文件的MD5值
- Android 技巧
- C语言深入
- java数字游戏
- 优先队列的使用
- git合并分支