Advertisement
Guest User

ZbirDeliteliMarina

a guest
Nov 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.  
  7. int n,max=-99999;
  8. scanf("%d",&n);
  9. int i,zapamtibroj;
  10. for(i=1;i<n;i++){
  11. int j;
  12. int zbirdeliteli=0;
  13. for(j=1;j<i;j++){
  14. if(i%j==0){
  15. zbirdeliteli+=j;
  16. }
  17. }
  18. if(zbirdeliteli>max){
  19. max=zbirdeliteli;
  20. zapamtibroj=i;
  21. }
  22. }
  23. printf("%d",zapamtibroj);
  24.  
  25.  
  26.  
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement