Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long int n; //mokama n centu
- long long int m; //pagautu zuviu kiekis
- long long int sum=0;
- cin>>n>>m;
- for(int i=1;i<m+1;i++)
- {
- sum+=pow(n,i);
- }
- cout<<sum<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement