我下面的这个程序怎么编译时老提示:D:\Cpp1.cpp(23) : fatal error C1083: Cannot open include file: 'mytime0.h': No such file or directory
//mytime0.h
#ifndef mytime_h
#define mytime_h
class Time
{
private:
int hours;
int minutes;
public:
Time();
Time(int h,int m=0);
void addmin(int m);
void addhr(int h);
void reset(int h=0,int m=0);
Time operator+(const Time & t)const;
void show()const;
};
#endif
//mytime0.cpp
#include <iostream>
#include "mytime0.h"
Time::Time()
{
hours=minutes=0;
}
Time::Time(int h,int m)
{
hours=h;
minutes=m;
}
void Time::addmin(int m)
{
minutes+=m;
hours+=minutes/60;
minutes%=60;
}
void Time::addhr(int h)
{
hours+=h;
}
void Time::reset(int h,int m)
{
hours=h;
minutes=m;
}
Time Time::operator(const Time & t)const
{
Time sum;
sum.minutes=minutes+t.minutes;
sum.hours=hours+t.hours+sum.minutes/60;
sum.minutes%=60;
return sum;
}
void Time::show()const
{
std::cout<< hours<<"hours,"<<minutes<<"minutes";
}
//usetime0.cpp
#include<iostream>
#include"mytime.h"
using namespace std;
int mian()
{
Time play;
Time coding(2,40);
Time fixing(5,55);
Time total;
cout << "play time is ";
play.show();
cout << endl;
cout << "coding time is ";
coding.show();
cout << endl;
cout << "fixing time is ";
fixing.show();
cout << endl;
total=coding+fixing;
cout << "coding+fixing is ";
total.show();
cout << endl;
return 0;
}