#include <iostream>
#include <cstdio>
using namespace std;
class date {
int day, month, year;
public:
date(char *d)
{
sscanf(d, "*c*cd", &month, &day, &year);
}
date(int m, int d, int y)
{
day = d;
month = m;
year = y;
}
void show_date()
{
cout << month << "/" << day;
cout << "/" << year << "\n";
}
};
int main()
{
date ob1(12, 4, 2003), ob2("10/22/2003");
ob1.show_date();
ob2.show_date();
return 0;
}
|