-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathshell.cpp
41 lines (33 loc) · 1.11 KB
/
shell.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
#include <iostream>
#include <sstream>
#include <iomanip> // std::setfill, std::setw
using namespace std;
int main() {
// CRIE SEU RELÓGIO AQUI
while (true) {
string line, cmd;
getline(cin, line);
cout << "$" << line << endl;
stringstream ss(line);
ss >> cmd;
if (cmd == "end") {
break;
} else if (cmd == "set") {
// Chame os métodos setHour, setMinute e setSecond
// int hour {}, minute {}, second {};
// ss >> hour >> minute >> second;
} else if (cmd == "init") {
// Chame o construtor para inicializar o relógio
// int hour {}, minute {}, second {};
// ss >> hour >> minute >> second;
} else if (cmd == "show") {
// Chame o método str e imprima o horário
// cout << time.str() << endl;
} else if (cmd == "next") {
// Chame o método nextSecond
// time.nextSecond();
} else {
cout << "fail: comando invalido" << endl;
}
}
}