关于#float#的问题,如何解决?

Visual studio运行时输入a后键入字母单词会准确返回,唯独首字母为n或i时输出为空。若是把输入换成int类型则没有问题,不知道什么原因
#include<stdio.h>
int manu(void);
int main(void)
{
int a = 0,r1,r2;
char ch,ch1;
double num1,num2;//要求输入float类型变量,若换为int类型则不会出现上述问题
while (a==0)
{
manu();
switch (ch = getchar())
{
case 'a':
printf("Enter first number: ");
while (scanf_s("%lf", &num1) != 1)
{
while((ch1=getchar())!='\n')
putchar(ch1);
printf(" is not a number.\n");
printf("Please enter a number.such as 2.5, -1.78E8, or 3: ");
}
break;
case 's':
case 'm':
case 'd':
case 'q':
printf("Bye.\n");
a++;
break;
}
}
return 0;
}
int manu(void)
{
printf("Enter the operation of your choice\n");
printf("a. add s. subtract\n");
printf("m. multiply d. divide\nq. quit\n");
return 0;
}

img