Untitled
Anonymous
plain_text
10/19/2023 3:14 PM
364 B
30
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...