Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int fdivisors(int n)
- {
- int i,j=0,counter=0,a[1000];
- for(i=2;i<n;i++)
- {
- if((n%i)==0)
- {
- a[j] = i;
- j++;
- counter++;
- }
- }
- if((counter==1)||(counter==0))
- {
- return(n);
- }
- else
- {
- return(fdivisors(a[counter])+fdivisors(a[counter-1]));
- }
- }
- int main()
- {
- int no,result;
- scanf("%d", &no);
- result = fdivisors(no);
- printf(result);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement