반응형
#include <cstdio>
void makeAndEatRamen() {
printf("라면을 만들어 먹는 작업을 시작합니다.\n");
auto boilWater = [&]() {
printf("냄비에 물을 끓이는 작업을 시작합니다.\n");
auto preparePot = [&]() {
printf("냄비를 준비합니다.\n");
};
preparePot();
auto turnOnFire = [&]() {
printf("가스레인지에 불을 붙힙니다.\n");
};
turnOnFire();
auto waitUntilBoil = [&]() {
printf("냄비의 물이 끓을 때 까지 기다립니다.\n");
};
waitUntilBoil();
printf("냄비에 물을 끓이는 작업을 완료하였습니다.\n");
};
boilWater();
auto putRamenIntoPot = [&]() {
printf("냄비에 라면을 넣는 작업을 시작합니다.\n");
auto putNoodleIntoPot = [&]() {
printf("냄비에 라면사리를 넣습니다.\n");
};
putNoodleIntoPot();
auto putSoupIntoPot = [&]() {
printf("냄비에 라면스프를 넣습니다.\n");
};
putSoupIntoPot();
printf("냄비에 라면을 넣는 작업을 완료하였습니다.\n");
};
putRamenIntoPot();
auto eatRamen = [&]() {
printf("라면을 먹는 작업을 시작합니다.\n");
auto prepareBowl = [&]() {
printf("라면을 담을 그릇을 준비합니다.\n");
};
prepareBowl();
auto putRamenIntoBowl = [&]() {
printf("라면을 그릇에 천천히 담습니다.\n");
};
putRamenIntoBowl();
auto startEatRamen = [&]() {
printf("라면을 먹습니다.\n");
};
startEatRamen();
printf("라면을 먹는 작업을 완료하였습니다.\n");
};
eatRamen();
printf("라면을 만들어 먹는 작업을 완료하였습니다.\n");
}
void main() {
makeAndEatRamen();
}
반응형
'컴퓨터 공학' 카테고리의 다른 글
[Vue.js] vuex의 상태 값의 변화를 감지해서 지역 변수에 반영하는 방법 (0) | 2019.04.13 |
---|---|
유용한 Node.js 글로벌 모듈 (0) | 2019.04.12 |
클린코드 정리 (0) | 2018.11.12 |
자바스크립트에서 콜백지옥으로 인한 들여쓰기 문제 해결하는 방법 (0) | 2018.11.12 |
퀵정렬에서 피봇을 선택하는 방법 (0) | 2018.09.12 |