fork download
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int main()
  5. {int a,x,y;
  6. ifstream f("bac.in");
  7. f>>a;
  8. while(f>>x)
  9. {if(a%x==0)
  10. {y=x;
  11. while(a%x==0)
  12. {x=x/a;}}
  13. if(x==0)
  14. cout<<y<<" ";
  15. }
  16. f.close();
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
Standard output is empty