| 题目链接 | 难度等级 | 完成状态 | 完成分数 | 最后编辑时间 | 失误原因(初次提交分数) |
|---|---|---|---|---|---|
| Sum Problem | ★☆☆☆☆ | 答案正确 | 100 | 2015-02-06 10:30:54 | 输出格式(0) |
来自寒假:Only a signing tool ! B 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1001
求1+2+...+n。
| 1001.cpp代码已折叠
展开折叠内容
|
|---|
#include<iostream>
using namespace std;
int main()
{
unsigned long long a;//fixed:using ull//
while(cin>>a)
{
unsigned long long t=(a+1)*a>>1;
cout<<t<<endl<<endl;//fixed:endl//
}
return 0;
}
|