Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <algorithm>
- #include <fstream>
- #include <iterator>
- using namespace std;
- int main(void)
- {
- /* ifstream fin ("small-powers.in");
- ofstream fout ("small-powers.out");*/
- vector <int> v(26);
- int n, k, x;
- cin>>n;
- k=n;
- x=n;
- if (n==1) {
- cout<<1;
- return 0;}
- else {
- cout<<1;
- generate(v.begin(), v.end(), [&] ()
- {cout<<x<<" ";
- if (x<=1e9 && (long long)(x*x) >= x)
- x = x*k;
- else
- x = 0;
- return x;
- });
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement