Răspuns :
Răspuns:
#include <iostream>
using namespace std;
int main(){
int n,p,x;
cin >> n >> p;
x = n;
while(x <= p){
cout << x << ' ';
x *= n;
}
}
#include <iostream>
void util(const int n, const int p){
for(int tm = n; tm <= p; tm *= n)
std::cout << tm << ' ';
}
int main(){
int n, p;
std::cin >> n >> p;
util(n, p);
return 0;
}