diff options
author | Oskar <[email protected]> | 2024-10-12 15:06:05 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-10-12 15:06:05 +0200 |
commit | 428d857359b5d8b639ca41b03ca8fc8b3d143a50 (patch) | |
tree | 6c6291c2404386673ef6cd65ad435374e519d35b /9p22.cpp | |
parent | f46aaa42631113d83bc211a9db4f85ef68afdc92 (diff) |
more
Diffstat (limited to '9p22.cpp')
-rw-r--r-- | 9p22.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/9p22.cpp b/9p22.cpp new file mode 100644 index 0000000..90a7f92 --- /dev/null +++ b/9p22.cpp @@ -0,0 +1,23 @@ +#include <iostream> +#include <vector> + +/* + * + * 9.22 + * + * I don't know what the author intends for the program to do. + * It may be obvious to the author but if he does tell me then + * it could be anything. + */ + +int main () { + + int some_val = 0; + std::vector<int> iv = {1,2,3,4,5,6,7,8}; + std::vector<int>::iterator iter = iv.begin(), + mid = iv.begin() + iv.size()/2; + while (iter != mid) + if (*iter == some_val) + iv.insert(iter, 2 * some_val); + return 0; +} |