35657

Untitled

Feb 2nd, 2024
1,215
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. int main() {
  6.  
  7.     setlocale(LC_ALL, "ru");
  8.  
  9.     int count;
  10.     cout << "Введите число: ";
  11.     cin >> count;
  12.  
  13.     int result = 0;
  14.  
  15.     for (int i = 0; i < count; i++) {
  16.         result += 15 + i * 2;
  17.     }
  18.  
  19.     cout << result << endl;
  20.  
  21.    
  22. }
Advertisement
Add Comment
Please, Sign In to add comment