Advertisement
Josif_tepe

Untitled

Mar 11th, 2022
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, x;
  8.     cin >> n >> x;
  9.     int suma = 0;
  10.     for(int i = 1; i <= n; i++)
  11.     {
  12.         suma += x*i;
  13.     }
  14.     cout << suma << endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement