-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsommai_shop_3.0.cpp
47 lines (44 loc) · 1.03 KB
/
sommai_shop_3.0.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
#include <iostream>
#include <string>
#include <vector>
class CUSTOMER
{
private:
std::string name, lastname, sex;
int year;
public:
CUSTOMER()
{
name = "";
lastname = "";
year = 0;
sex = "";
}
CUSTOMER(std::string name, std::string lastname, int year, std::string sex)
{
this->name = name;
this->lastname = lastname;
this->year = year;
this->sex = sex;
}
void print(){
std::cout << this->name << ' ' << this->lastname << ' ' << "(age : " << 2017 - this->year << ')' << std::endl;
}
};
int main()
{
int number;
std::vector<CUSTOMER> database;
std::cin >> number;
for(int i = 0; i < number; i++)
{
std::string name, lastname, sex;
int year;
std::cin >> name >> lastname >> year >> sex;
database.push_back(CUSTOMER(name, lastname, year, sex));
}
std::cout << "--Customers Information--" << std::endl;
for(int i = 0; i < number; i++)
database[i].print();
return 0;
}