Saleh127

uva 10699.cpp

Jun 8th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long int
  4. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  5. #define maX 1000005
  6. int main()
  7. {
  8. Faster
  9. ll a,c,d,e,factor,i,j,k,l;
  10. while(scanf("%lld",&a) && a)
  11. {
  12. c=a;
  13. factor=0;
  14. for(i=2;i<=sqrt(a); i++)
  15. {
  16. if(a%i==0)
  17. {
  18. factor++;
  19. while(a%i==0)
  20. {
  21. a=a/i;
  22. }
  23. }
  24. }
  25. if(a>1) factor++;
  26. printf("%lld : %lld\n",c,factor);
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment