summaryrefslogtreecommitdiff
path: root/8p2.cpp
diff options
context:
space:
mode:
Diffstat (limited to '8p2.cpp')
-rw-r--r--8p2.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/8p2.cpp b/8p2.cpp
new file mode 100644
index 0000000..653e4be
--- /dev/null
+++ b/8p2.cpp
@@ -0,0 +1,34 @@
+#include <iostream>
+
+/*
+ *
+ * 8.2
+ *
+ *
+ */
+
+std::istream &read_print_report(std::istream &rpr) {
+
+ int a;
+ while(rpr >> a) {
+ std::cout << a;
+ }
+
+ if(rpr.good()) { std::cout << "good" << std::endl; }
+ if(rpr.eof()) { std::cout << "eof" << std::endl; }
+ if(rpr.fail()) { std::cout << "fail" << std::endl; }
+ if(rpr.bad()) { std::cout << "bad" << std::endl; }
+ rpr.clear();
+ std::cout << "--- cleared --- \n";
+ if(rpr.good()) { std::cout << "good" << std::endl; }
+ if(rpr.eof()) { std::cout << "eof" << std::endl; }
+ if(rpr.fail()) { std::cout << "fail" << std::endl; }
+ if(rpr.bad()) { std::cout << "bad" << std::endl; }
+ return rpr;
+}
+
+int main () {
+
+ read_print_report(std::cin);
+ return 0;
+}