Advertisement
SelinD

ex115

May 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int functie(int n)
  5. {
  6. int d=2,p,cate=0;
  7. while(n>1)
  8. {
  9. p=0;
  10. while(n%d==0)
  11. {
  12. p++;
  13. n=n/d;
  14. }
  15. if(p>0) cate++;
  16. d++;
  17. }
  18. return cate;
  19. }
  20.  
  21. int main()
  22. {
  23. int n,i,x,fmax=0;
  24. cin>>n;
  25. for(i=1; i<=n; i++)
  26. {
  27. cin>>x;
  28. if(functie(x)>fmax)
  29. {
  30. fmax=functie(x);
  31. }
  32. }
  33. cout<<fmax<<" ";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement