问题遇到的现象和发生背景 在做一道练习题时出现了死循环。
用代码块功能插入代码,请勿粘贴截图
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int start,end,width;
while(scanf("[%d:%d]",&start,&end)!=EOF)
{
width=abs(start-end)+1;
if(width<=32)
printf("%d",width);
else
printf("Too Big!");
}
return 0;
}
运行结果及报错内容
死循环输出一个数
我想要达到的结果
是什么问题让这个不定输入的循环只输出一个数。如何才能正常运行