forked from yukimiii/47prefecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hiroshima.cpp
51 lines (45 loc) · 1.01 KB
/
hiroshima.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
#include <string>
#include <iostream>
#include <cstdlib>
#undef WAR
static int peace = 1;
class Food
{
private:
std::string _type;
public:
Food(std::string const &type): _type(type) {}
virtual ~Food() {}
Food(Food const &rhs): _type(rhs._type) {}
Food process(std::string const &type)
{
this->_type = this->_type + " " + type;
return *this;
}
std::string const &process() const
{
return this->_type;
}
Food operator+(Food const &rhs) const
{
return Food("(" + this->_type + " " + rhs._type + " +)");
}
};
std::ostream &operator<<(std::ostream &ost, Food const &rhs)
{
return ost << rhs.process();
}
int main()
{
Food okonomiyaki = ((Food("小麦粉")+Food("水")).process("混ぜる")
+(Food("野菜")+Food("肉"))+Food("麺").process("炒める")
+Food("卵").process("伸ばす")
).process("焼く").process("重ねる")
+(Food("ソース")+Food("青海苔"));
std::cout << "広島::お好み焼き = " << okonomiyaki << std::endl;
while (peace++)
;
if (!peace)
abort();
return (0);
}