fork download
  1. #include <bits/stdc++.h>
  2. #define ll long long
  3. #define YES cout << "YES\n";
  4. #define NO cout << "NO\n";
  5. #define opps cout<<-1<<endl;
  6. const ll con = 1e10 + 5;
  7. using namespace std;
  8. class rectangle {
  9. double height ;
  10. double width ;
  11. public:
  12. rectangle();
  13. double get_area() ;
  14. double get_perimeter() ;
  15. double get_height() ;
  16. double get_width() ;
  17. void set_width(double width_) ;
  18. void set_height(double height_) ;
  19. };
  20. rectangle::rectangle() {
  21. width = height = 0;
  22. }
  23. double rectangle::get_area() {
  24. return width * height;
  25. }
  26. double rectangle::get_perimeter() {
  27. return width + height ;
  28. }
  29. double rectangle::get_height() {
  30. return height;
  31. }
  32. double rectangle::get_width() {
  33. return width;
  34. }
  35. void rectangle::set_height(double height_) {
  36. height = height_;
  37. }
  38. void rectangle::set_width(double width_) {
  39. width = width_;
  40. }
  41. int main() {
  42. ios::sync_with_stdio(0);
  43. cin.tie(0);
  44. ll n ;
  45. cin>>n;
  46. ll sum = ((n * (n+1)) / 2);
  47. cout<<sum;
  48. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
1730353505058913928