diff options
author | crupest <crupest@outlook.com> | 2021-06-12 23:20:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-12 23:25:49 +0800 |
commit | dc0dfeec23158268268da5a16364abb1f0de5a06 (patch) | |
tree | 845fb99b4f5d80cc5a99019d5af8598abf5f7e45 /works/life/operating-system-experiment/DeadLockDetectionDemo.cpp | |
parent | 2c7ceca3e58543c36098fd46de711d9cd80a4d12 (diff) | |
download | crupest-dc0dfeec23158268268da5a16364abb1f0de5a06.tar.gz crupest-dc0dfeec23158268268da5a16364abb1f0de5a06.tar.bz2 crupest-dc0dfeec23158268268da5a16364abb1f0de5a06.zip |
import(life): ...
Diffstat (limited to 'works/life/operating-system-experiment/DeadLockDetectionDemo.cpp')
-rw-r--r-- | works/life/operating-system-experiment/DeadLockDetectionDemo.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp b/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp new file mode 100644 index 0000000..b22549e --- /dev/null +++ b/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp @@ -0,0 +1,25 @@ +#include <fstream>
+#include <iostream>
+#include <vector>
+
+int main() {
+ std::vector<int> ns;
+
+ while (!std::cin.eof() || std::cin) {
+ int n;
+ std::cin >> n;
+ ns.push_back(n);
+ }
+
+ if (!std::cin.eof()) {
+ std::cerr << "Failed to parse input.\n";
+ return -1;
+ }
+
+ if (ns.size() % 2 != 0) {
+ std::cerr << "Input integer number must be even.\n";
+ return -1;
+ }
+
+
+}
|