嗨,我已经编写了这段代码,但输出如下:
你旅行了多少英里?:(你显示的次数)
你消耗了多少加仑汽油?:
然后它只是跳过扫描并移动到下一个位置,
#include <stdio.h>
#include <string.h>
#include <float.h>
int main ()
{
float mile;
float gallon;
printf("How many Miles have u traveled?: ");
scanf("%.1f",&mile);
printf("How many gallons of gasoline have u consumed?: ");
scanf("%.1f",&gallon);
}