请大家看看这个程序,在VS里一直在报错这是为什么啊?而且为什么只有那一个地方报错下面的为啥不报错?
#include<iostream>
using namespace std;
int main()
{
int time;
float wage_per_hour, wage;
cout << "Please input employee’s work time and wage_per_hour:" << endl;
cin >> time >> wage_per_hour;
while (time)
{
if (time == 0)
return 0;
if (time > 0)
{
if (time <= 40)
wage = time * wage_per_hour;
if (time > 40)
wage = 40 * wage_per_hour + (time - 40) * 1.5 * wage_per_hour;
if (time > 50)
wage = 50 * wage_per_hour + (time - 50) * 3 * wage_per_hour;
cout << "The employee’s wage :" << wage << endl;
cout << "Please input employee’s work time and wage_per_hour:";
cin >> time >> wage_per_hour;
}
}
system("pause");
}