문제출처 : https://www.acmicpc.net/problem/18004
code
#include <iostream>
using namespace std;
int main()
{
int a, b, cnt = 0;
cin >> a >> b;
while (a!=b)
{
if (a>b && a % 2==1)
{
a++;
cnt++;
}
else if(a>b && a%2==0)
{
a /=2;
cnt++;
}
else if (a < b)
{
a++;
cnt++;
}
}
cout << cnt;
return 0;
}