main写错了,int main() 写成了 int mian()
#include
using namespace std;
class Time
{
private:
int hour;
int minute;
int second;
int t;
public:
void setTime();
void showTime(Time t1,Time t2);
};
void Time::setTime()
{
cin>>hour>>minute>>second;
}
void Time::showTime(Time t1,Time t2)
{
t=t2.hour3600+t2.minute60+t2.second-t1.hour3600-t1.minute60-t1.second;
cout<<t<<endl;
}
int main()
{
Time t1,t2,t3;
t1.setTime();
t2.setTime();
t3.showTime(t1,t2);
return 0;
}
有没有人知道我编译成功了为什么还是按上一个运行的
这个代码3600和60前面是有乘号的 粘过来看不见了