fork download
  1. #include<iostream>
  2. using namespace std;
  3. int n, S;
  4. int main() {
  5. cin >> n;
  6. S = 0;
  7. for(int i = 1; i <= n; i++){
  8. S = S + i;}
  9. cout << S;
  10. return 0; }
  11.  
Success #stdin #stdout 0.01s 5288KB
stdin
3547
stdout
6292378