fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. long long n;
  5. scanf("%lld", &n);
  6. printf("%lld", n * ( n + 1 ) / 2 );
  7. return 0;
  8. }
  9.  
Success #stdin #stdout 0s 548KB
stdin
5
stdout
15