这个是为什么呢
#include <stdio.h>int main()
{
float num = 0;
double sum = 0;
int status,l;
do
{
printf("请输入合法的数字:");
do
{
sum = sum + num;
status = scanf("%f", &num);
l++;
} while (getchar() != '\n');
} while(status == 1);
printf("结果是:%.2lf\n", sum);
return 0;
}
为什么输入非法时,dowhile那个跳不出来