scanf("%d",&x); x 为 float x; 而 %d 为整数,所以 x 不能被正确赋值,两种解决方法:将 scanf("%d",&x); 改为:scanf("%f",&x); 或者:将 float x; 改为 int x;
你确信光标闪烁不是在等你输入吗?