Saleh127

UVA 10392.cpp

Jun 27th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9.  
  10. ll a,c,d,e,f,i;
  11. while(cin>>a && a>0)
  12. {
  13. while(a%2==0)
  14. {
  15. cout<<" 2"<<endl;
  16. a/=2;
  17. }
  18. for(i=3;i*i<=a;i+=2)
  19. {
  20. while(a%i==0)
  21. {
  22. cout<<" "<<i<<endl;
  23. a/=i;
  24. }
  25. }
  26. if(a>1) cout<<" "<<a<<endl<<endl;
  27. }
  28.  
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment