#include<stdio.h>
int b[11]={0,1,2,3,4,5,6,12,13,18,19},n;
int z(int x,int y)
{
int z;
if(x<=y)
{
z=(x+y)/2;
if(b[z]==n)
return z;
if(b[z]<n)
return zhd(z+1,y);
else
return zhd(x,z-1);
}
}
int main()
{
int d=0,x=1,y=10;
scanf("%d",&n);
d=z(x,y);
if(d==0)
printf("NO");
else
printf("%d",d);
return 0;
}
时间: 2024-10-15 12:48:19