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