数学专项counting:UVa 10079
2013-03-28 22:56
281 查看
很简单找规律,结果为(n*n+n+2)/2。
#include <iostream> #include <fstream> #include <cstring> #include <cstdio> using namespace std; typedef long long LL; LL n; int main() { freopen("in.txt","r",stdin); while(cin>>n) { if(n<0) break; cout<<(n*n+n)/2+1<<endl; } return 0; }
相关文章推荐
- 数学专项counting:UVa 11529
- 数学专项counting:UVa 11038
- 数学专项counting:UVa 10883
- 数学专项counting:UVa 11481
- 数学专项counting:UVa 10237
- 数学专项counting:UVa 10128
- 数学专项counting:UVa 10081
- 数学专项counting:UVa 580
- 数学专项counting:UVa 417
- 数学专项number_theory:UVa 10539
- 数学专项counting:LA 3295
- Triangle Counting+uva+数学题
- 数学专项number_theory:UVa 11105
- 数学专项number_theory:UVa 756
- 数学专项counting:LA 4064
- 数学专项number_theory:UVa 10127
- 数学专项number_theory:UVa 10692
- 数学专项permutation:UVa 306
- 数学专项number_theory:UVa 718
- 数学专项game_theory:UVa 11927