C语言:二分法猜数字;无法跳出循环且输入部分数字程序会卡住;求大神解答

1.C语言:二分法猜数字;无法跳出循环且输入部分数字程序会卡住
2.

#include <stdio.h>
int main() 
{
    int c;
    int a;
    int b; 
    int num; 
    char one;
    char two;
    one = 0;
    printf("Please enter your number(from '0'to'100'):");
    scanf("%d",&num);
    b=0;
    a=100;
    c = (a+b)/2.0;
    while(one!= 'y')    
         {
             KK:
             if((num >= '0')&&(num <= '100'))
              {
                RE:
                printf("%d'Y'or'N'\n",c);
                printf("Up is %d,Down is %d\n",a,b);
                one=getchar();
                  if(one == 'n')
                     {
                        GG:
                        two=getchar();
                        if(two == 'b')
                        {
                            b=c;
                            c=(a+c)/2.0;
                            goto RE;
                        }
                        else
                        if(two == 's')
                        {
                            a=c;
                            c=(b+c)/2.0;
                            goto RE;
                        }
                        else
                            {
                              printf("Please enter 'b' or 's'\n");
                              goto GG; 
                            }       
                     }
                    else
                    if((a != 'N') &&  (a !=  'Y'))
                    {
                        goto RE;
                     } 

              }
              else
              if((num <= '0')&&(num >= '100'))
              {
                goto KK;
              }
         }
    printf("The number is %d",c);
    return 0;    
}

3.
图片说明图片说明

好好整理下代码,你的num根本没有放在循环里输入,不会变化
而且
num >= '100'
这种写法不合法
应该是
int num;
scanf(("%d", &num);
if (num >= 100)
字符不能这么比较