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