Josif_tepe

Untitled

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