-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3-2★.cpp
63 lines (53 loc) · 923 Bytes
/
3-2★.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include <cstring>
using namespace std;
class Date {
int year;
int month;
int day;
public:
Date(int a, int b, int c) {
year = a;
month = b;
day = c;
}
Date(string a) {
int check, check1;
char date[100];
strcpy(date, a.c_str());
for (int i = 0; i < strlen(a.c_str()); i++) {
if (date[i] == '/') {
if (i == 5) {
check = i;
}
else {
check1 = i;
}
}
}
for(int i = 0; i <)
//ÇØ°á ½ÇÆÐ
}
int getYear();
int getMonth();
int getDay();
void show();
};
int Date::getYear() {
return year;
}
int Date::getMonth() {
return month;
}
int Date::getDay() {
return day;
}
void Date::show() {
cout << year << "³â" << month << "¿ù" << day << "ÀÏ" << endl;
}
int main() {
Date birth(2014, 3, 20);
Date independenceDay("1945/8/15");
independenceDay.show();
cout << birth.getYear() << ',' << birth.getMonth() << ',' << birth.getDay() << endl;
}