diff options
author | Oskar <[email protected]> | 2024-10-05 14:23:02 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-10-05 14:23:02 +0200 |
commit | d5fcdab87a013b2c919b66ea9a52b469620ca49f (patch) | |
tree | d4f5018348d7d40b2ace6e01af3fb6803795f23e /8p2.cpp | |
parent | 2f1ad9ec273a0ff9e746e9f6c4cac2ce81cb31e4 (diff) |
more
Diffstat (limited to '8p2.cpp')
-rw-r--r-- | 8p2.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -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; +} |