Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
271 B
11
Indexable
Never
#include <stdio.h>

int main()
{
    int N;
    scanf("%d", &N);

    int count = 0;

    while (N != 1) {
        if (N % 2 == 0)
            N /= 2;
        else
            N += 1;
        count++;
    }

    printf("%d\n", count);

    return 0;
}