Advertisement
Josif_tepe

Untitled

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