fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin >> n;
  8. unsigned long long int counter = ((1 + n) * n) / 2;
  9. cout << counter;
  10. return 0;
  11. }
Success #stdin #stdout 0s 15224KB
stdin
5
stdout
15