赞
踩
- //Date.h
- #ifndef DATE_H
- #define DATE_H
- #include <iostream>
- #include <map>
- #include <vector>
- using namespace std;
- class Date{
- public:
- explicit Date(string&str){
- if(mymap.empty()) initMap();
- if(!CheckStrFomat(str)){
- cout<<"The string does not conform to the format!"<<endl;
- ErrorInit();
- return;
- }
- string MonthStr=str.substr(0,str.find_first_of(", /"));
- string DayStr=str.substr(str.find_first_of(", /")+1,str.find_last_of(", /")-str.find_first_of(", /")-1);
- string YearStr=str.substr(str.find_last_of(", /")+1);
- if(!InitDate({YearStr,MonthStr,DayStr})) ErrorInit();
- }
- void print(){
- cout<<year<<' '<<mon
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。