冰雹猜想

3n+1猜想

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N = 0;
    int StepNums = 0;
    while (cin >> N)
    {
        if (!N)
            break;
        StepNums = 0;
        while (N != 1)
        {
            StepNums++;
            if (N % 2)
                N = (3 * N + 1) / 2;
            else
                N /= 2;
        }
        cout << StepNums << endl;
    }
    return 0;
}