Advertisement
Josif_tepe

Untitled

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