اشکال در یه برنامه خیلی ساده !!!
سلام کد زیر درست اجرا نمی شه
ممکنه کمکم کنید و مشکل را بهم بگید :46:
[PHP]#include <iostream.h>
int main ()
{
int gallon = 1,
miles = 1,
subG = 0,
subM = 0;
cout << "Enter the Gallon used ( -1 to end ): " ;
while ( ( gallon = cin.get() ) != -1 )
{
subG += gallon;
cout << "\nEnter the miles driven : ";
cin >> miles;
subM += miles;
cout << "\nThe miles / Gallonfor this tank was :" << miles / gallon << endl;
cout << "\nEnter the Gallon used ( -1 to end ) : " ;
}
cout << "\nEnter overall averrage miles /Gallon was :" << subM / subG << endl;
return 0;
}[/PHP]