Guest User

Untitled

a guest
Oct 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n,s,c,i,a,b,mx;
  5. while(scanf("%d%d",&a,&b)!=EOF)
  6. {
  7. for(i=a; i<=b; i++)
  8. {
  9. mx=0;
  10. c=1;
  11. while(i!=1);
  12. {
  13. if (i%2==0) i=(int)(i/2);
  14. else i=(i*3)+1;
  15. c=c+1;
  16. }
  17. if(mx<c) mx=c;
  18. }
  19. printf("%d\n",mx);
  20. }
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment