#include <iostream>
#include <string>
using namespace std;
int main(){
cout<<"Enter? please a date in the format dd/mm/yy \n";
string date;
cin>>date;
string temp;
temp += date[0];
temp += date[1];
int dd = atoi(temp.c_str());
temp.clear();
temp += date[3];
temp += date[4];
int mm = atoi(temp.c_str());
temp.clear();
temp += date[6];
temp += date[7];
int yy = atoi(temp.c_str());
temp.clear();
string months[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
cout<<"The data is - " << months[mm-1] << ' ' << dd ;
if (yy<14) cout<<", 20"<<yy<<endl;
else cout<<", 19"<<yy<<endl;
system("pause");
return 0;
}
Comments
Leave a comment