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