CPP
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
/*
Challenge: plan activities of last
24 hrs in one week from 'now'
04-07-18, Eric Zatarack
*/
#include <iostream>
using namespace std;
enum Plan{code=1, eat=2, read=3, sleep=4, drive=5};
int main() {
Plan act;
for (act=code; act<=drive; act=static_cast<Plan>(act+1)) {
switch (act) {
case 1:
cout << "priority "<< act << ": code" << endl;
break;
case 2:
cout << "priority "<< act << ": eat" << endl;
break;
case 3:
cout << "priority "<< act << ": read" << endl;
break;
case 4:
cout << "priority "<< act << ": sleep" << endl;
break;
case 5:
cout << "priority "<< act << ": drive" << endl;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run