35657

Untitled

Nov 2nd, 2023
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.  
  8.     setlocale(LC_ALL, "ru");
  9.  
  10.     int count;
  11.  
  12.     cout << "Введите число: ";
  13.     cin >> count;
  14.  
  15.     int result = 0;
  16.  
  17.     for (int i = 0; i < count; i++) {
  18.         result += 15 + i * 2;
  19.     }
  20.  
  21.     cout << result << endl;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment