不明白,为什么?
while ( gallons != -1 ){
cout << "Enter the gallons used (-1 to end): ";
cin >> gallons;
if ( gallons == -1 )
break;
cout << "Enter the miles driven: ";
cin >> gallons;
cout << "The miles / gallon for this tank was "
<< miles/gallons << endl;
gallons_tatol += gallons;
miles_tatol += miles;
}
不能输入第二个数值。