Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void find_divider(int n)
- {
- const inf=-1e9;
- int divider,remainder_max=inf;
- for(int i=1;i<=200;i++){
- remainder=n%i;
- if(remainder>remiander_max){
- remainder_max=remainder;
- divider=i;
- }
- }
- printf("%d",divider);
- }
- int main()
- {
- int n;
- scanf("%d",&n);
- find_divider(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement