We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee3cd18 commit 61bd9afCopy full SHA for 61bd9af
src/main.cpp
@@ -2,17 +2,16 @@
2
#include <string>
3
4
int main() {
5
- // Flush after every std::cout / std:cerr
6
- std::cout << std::unitbuf;
7
- std::cerr << std::unitbuf;
+ // Flush after every std::cout / std:cerr
+ std::cout << std::unitbuf;
+ std::cerr << std::unitbuf;
8
9
- std::string input;
10
- while(true) {
11
- std::cout << "$ ";
12
- std::getline(std::cin, input);
13
- if (input == "") {
14
- break;
15
- }
16
- std::cout << input << ": command not found" << std::endl;
17
18
-}
+ std::string input;
+ do {
+ std::cout << "$ ";
+ std::getline(std::cin, input);
+ if (input != "") {
+ std::cout << input << ": command not found" << std::endl;
+ }
+ } while(input != "");
+}
0 commit comments