Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. void find_divider(int n)
  4. {
  5.     const inf=-1e9;
  6.     int divider,remainder_max=inf;
  7.     for(int i=1;i<=200;i++){
  8.         remainder=n%i;
  9.         if(remainder>remiander_max){
  10.             remainder_max=remainder;
  11.             divider=i;
  12.         }
  13.     }
  14.     printf("%d",divider);
  15. }
  16.  
  17. int main()
  18. {
  19.     int n;
  20.     scanf("%d",&n);
  21.     find_divider(n);
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement