Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;// ||sau
- int main() {
- int n,d,nr,i=1,nrdiv,maxi=2,copynr;
- cout<<"n=";cin>>n;
- while (i<=n)
- {
- nrdiv=2;
- d=2;
- cout<<"nr"<<i<<"=";
- cin>>nr;
- while (d<=nr/2)
- {
- if (nr%d==0)
- nrdiv++;
- d++;
- }
- if (nrdiv>maxi)
- {
- maxi=nrdiv;
- copynr=nr;
- }
- i++;
- }
- cout<<"nr cu cei mai multi divizori e "<<copynr<<endl<<"nr divizori: "<<maxi;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement