#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
double mile, tmile = .0, aver;
int gallons, tgallons;
cout << "请输入本次里程数:";
cin >> mile;
cout << setprecision(6) << fixed;
while (mile != EOF)
{
cout << "请输入这次使用的汽油加仑:";
cin >> gallons;
aver = mile / static_cast<double>(gallons);
cout << "这次的耗油效率:"<<aver << endl;
tmile = tmile + mile;
tgallons = tgallons + gallons;
cout <<"总的耗油里程效率:"<< tmile /static_cast<double>(tgallons)<< endl;
cout << endl;
cout << endl;
cout << "请输入本次里程数:";
cin >> mile;
}
cout << endl;
}