fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. long long n;cin>>n;
  7. cout<<(n*(n+1))/2;
  8. return 0;
  9. }
Success #stdin #stdout 0.01s 5312KB
stdin
4
stdout
10