STL ATM交易记录类

#include
using namespace std;
class Time
{
    int month,day,hour,minute;
    public:
    Time(){
    month=0;day=0;hour=0;minute=0;
    }
    Time(int month1,int day1,int hour1,int minute1):month(month1),day(day1),hour(hour1),minute(minute1){}

    Time & operator = (const Time & t){
    month=t.month;
    day=t.day;
    hour=t.hour;
    minute=t.minute;
    }//重载等号

    friend ostream & operator<<(ostream&os,const Time&t);
    friend istream & operator>>(istream&is,Time&t);

    void setmonth(int month1){month=month1;}
    int getmonth(){return month;}

    void setDay(int day1){day=day1;}
    int getDay(){return day;}

    void setHour(int hour1){hour=hour1;}
    int getHour(){return hour;}

    void setMinute(int minute1){minute=minute1;}
    int getMinute(){return minute;}

   // void display();
};

ostream & operator<<(ostream&os,const Time&t){
  os<>(istream&is,Time&t){
  is>>t.month>>t.day>>t.hour>>t.minute;
  return is;
}

//bool operator < (const Time&t){
  //return month!=month?month> (istream&is,Record &r);

    void setType(string type1){type=type1;}
    string getType(){return type;}

    void getJine(int jine1){jine=jine1;}
    int getJine(){return jine;}

    void setYue(double yue1){yue=yue1;}
    double getYue(){return yue;}

};

ostream & operator<<(ostream&os,const Record&r){
  os<>no>>type>>jine>>yue;
    Record r1(no,t1,type,jine,yue);
    cin>>no>>month>>day>>hour>>minute>>type>>jine>>yue;
    Record r2(no,month,day,hour,minute,type,jine,yue);
    cout<

你可能感兴趣的:(STL ATM交易记录类)