Untitled

 avatar
unknown
plain_text
a year ago
271 B
15
Indexable
#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;
}
Editor is loading...