|
|
back to boardWhat is Wrong? # include <iostream> #include <cmath> #include <vector> using namespace std; int main() { vector < int > asd; int a,b,c,d,e=0;
cin>>a>>b>>c;
for(double i=1;i<=999;i++) { if(i<=b) { d=pow(i,a); if(d%b==c) asd.push_back(i);
else e++; } } if(e==b) cout<<"-1"; else { cout<<asd[0]; for(int i=1;i<asd.size();i++) cout<<' '<<asd[i]; }
getchar(); getchar();
return 0; } Re: What is Wrong? I think you should delete lines: getchar(); |
|
|