UVA에서 처음 풀어본 문제...
int로 계속하다가 연이은 WA.. ㅠ
간단한건데 시간만 조넨 낭비한 느낌...
동적으로도 나중에 풀어봐야지 ^^
#include<stdio.h>
int main(void){
int i,n,temp,max,cnt,a,b,p1,p2;
unsigned long k; p1=a;
while(scanf("%d %d",&a,&b)==2){
p2=b;
if(a>b){
temp=a;
a=b;
b=temp;
}
max=0;
for(i=a;i<=b;i++){
k=i;
cnt=1;
while(k>1){
if(k%2==1){
k=(3*k)+1;
cnt++;
}
while(k%2==0){
k=k/2;
cnt++;
}
}
if(cnt>max){
max=cnt;
}
}
printf("%d %d %d\n",p1,p2,max);;
}
return 0;
}