Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int functie(int n)
- {
- int d=2,p,cate=0;
- while(n>1)
- {
- p=0;
- while(n%d==0)
- {
- p++;
- n=n/d;
- }
- if(p>0) cate++;
- d++;
- }
- return cate;
- }
- int main()
- {
- int n,i,x,fmax=0;
- cin>>n;
- for(i=1; i<=n; i++)
- {
- cin>>x;
- if(functie(x)>fmax)
- {
- fmax=functie(x);
- }
- }
- cout<<fmax<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement