帮我改改这个程序,谢谢

来源:百度知道 编辑:UC知道 时间:2024/09/22 13:44:38
#include <iostream>
using std::cout;
using std::cin;
using std::endl;

#include <iomanip>
using std::setw;

double charge;
double calculateCharges(double hour)
{

if(hour<=3.0)
{
charge=2.0;
}
else
{
if(hour<16.0)

charge=(hour-3)*0.5+2;
else
charge=10;

}
return charge;
}

string zuihou(double time)
{
int i=1;
cout<<setw(2)<<i;
cout<<setw(10)<<time;
cout<<setw(15)<<calculateCharges(time)<<endl;
i++;

}

int main()
{

double hour1,hour2,hour3;

cout<<setw(2)<<"Car";
cout<<setw(10)<<"Hours";
cout<<setw(15)<<"Charge";
cout<<endl;

cout<<"输入您的停车时间"&

#include <iostream>
// #include <string>
// using std::string;
using std::cout;
using std::cin;
using std::endl;

#include <iomanip>
using std::setw;

double charge;
double calculateCharges(double hour)
{

if(hour<=3.0)
{
charge=2.0;
}
else
{
if(hour<16.0)

charge=(hour-3)*0.5+2;
else
charge=10;

}
return charge;
}

void zuihou(double time)
{
int i=1;
cout<<setw(2)<<i;
cout<<setw(10)<<time;
cout<<setw(15)<<calculateCharges(time)<<endl;
i++;

}

int main()
{

double hour1,hour2,hour3;

cout<<setw(2)<<"Car";
cout<<setw(10)<<"Hours";
cout<<setw(15)<<"Charge";
cout<<endl