Untitled
unknown
plain_text
2 years ago
271 B
16
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...