用多态性实现工资发放系统 源代码.docxVIP

  • 8
  • 0
  • 约2.41万字
  • 约 19页
  • 2023-08-01 发布于辽宁
  • 举报
#ifndef HEADER_KESHE1 #define HEADER_KESHE1 class Birthdate { unsigned year,month; public : Birthdate(unsigned=1900, unsigned=01); void SetYear(unsigned); void SetMonth(unsigned); unsigned GetYear() const; unsigned GetMonth() const; friend ostream operator(ostream out, Birthdate b){ return outsetw(6) b.year / setw(2) setfill(0) b.month; } friend istream operator(istream in,Birthdate b){ string buf; in buf; b.SetYear(atoi(buf.substr(0,4).c_str())); b.SetMonth(atoi(buf.substr(5,2).c_str())); return in; } friend ofstream operator(ofstream fout, Birthdate b){ fout setfill( )b.GetYear() /; fout

文档评论(0)

1亿VIP精品文档

相关文档