diff options
author | Oskar <[email protected]> | 2024-10-09 16:55:14 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-10-09 16:55:14 +0200 |
commit | 12f648998464e7820e2be633e4d999c285047bce (patch) | |
tree | e596da0ae5017c139da37a88ffb4f9b595a7e03b /9p16.cpp | |
parent | e06a1fdebe095ad46b0607297f78077fccb11db1 (diff) |
more
Diffstat (limited to '9p16.cpp')
-rw-r--r-- | 9p16.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/9p16.cpp b/9p16.cpp new file mode 100644 index 0000000..0ddc0e4 --- /dev/null +++ b/9p16.cpp @@ -0,0 +1,52 @@ +#include <iostream> +#include <vector> +#include <list> + +/* + * + * 9.16 + * + * + */ + +int main () { + + std::vector<int> v1; + std::list<int> v2; + int in = 0; + std::cout << "v1" << std::endl; + for(int i = 0 ; i < 10 ; ++i) { + if(std::cin >> in) {} else { + std::cout << "Error: Wrong input." << std::endl; + return -1; + } + + v1.push_back(in); + } + + std::cout << "v2" << std::endl; + for(int i = 0 ; i < 10 ; ++i) { + if(std::cin >> in) {} else { + std::cout << "Error: Wrong input." << std::endl; + return -1; + } + + v2.push_back(in); + } + + bool iseq = true; + auto v1beg = v1.cbegin(); + auto v2beg = v2.cbegin(); + for( ; v1beg != v1.cend() && v2beg != v2.cend() ; ++v1beg, ++v2beg) { + if(*v1beg != *v2beg) { + iseq = false; + break; + } + } + + if(iseq == true) { + std::cout << "equal!" << std::endl; + } + + return 0; +} |