Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ATENTIE! Acesta este un subprogram. Pentru a il utiliza, lipeste-l in sursa ta si apeleaza functia! */
- unsigned int nrdiv(unsigned int a)
- {
- unsigned int e,d,rez;
- e=0;
- while(a%2==0)
- {
- a/=2;
- e++;
- }
- rez=e+1;
- d=3;
- while(a>1 && d*d<=a)
- {
- e=0;
- while(a%d==0)
- {
- a/=d;
- e++;
- }
- rez*=(e+1);
- d+=2;
- }
- if(a>1)
- rez*=2;
- return rez;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement