Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n,s,c,i,a,b,mx;
- while(scanf("%d%d",&a,&b)!=EOF)
- {
- for(i=a; i<=b; i++)
- {
- mx=0;
- c=1;
- while(i!=1);
- {
- if (i%2==0) i=(int)(i/2);
- else i=(i*3)+1;
- c=c+1;
- }
- if(mx<c) mx=c;
- }
- printf("%d\n",mx);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment