src2020/1660_n+/main.cpp

16 lines
215 B
C++
Raw Normal View History

2020-04-24 13:51:38 +08:00
//<2F>׼ӣ<D7BC><D3A3><EFBFBD>С<EFBFBD><D0A1>
#include <iostream>
using namespace std;
long long dg(long long n){
if(n==1){
return 1;
}
return n+dg(n-1);
}
int main()
{
int n;
cin>>n;
cout<<dg(n);
}