def center(start,end):
if (end-start+1)%2==1:
return(centerindex=(+1)//2)
else:
return(centerindex=(end-start+1)//2+1)
a=['',1,2,3,4,5,6,7,8,9,10]
start=1
end=10
cnt=0
n=int(input())
while True:
if n>a[center(start,end)]:
start=center(start,end)+1
cnt+=1
elif n<a[center(start,end)]:
end=center(start,end)-1
cnt+=1
else:
cnt+=1
break
진로스쿨 중간저장
admin 2024-08-18 12:21:00