Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <stdio.h>
  5. #include <cmath>
  6. using namespace std;
  7. int main(){
  8. long long n, cnt;
  9. cin >> n;
  10. vector< long long> prost;
  11. long long i = 2;
  12. while (i*i<n){
  13. if (n%i==0)
  14. {
  15. for(cnt=0;cnt<n;cnt++)
  16. n = n/i;
  17. if (cnt ==2)
  18. {
  19. prost.push_back(cnt);
  20. }
  21.  
  22. }
  23. } i++;
  24. for (auto elem: prost)
  25. cout << elem << endl;
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement