diff options
author | Oskar <[email protected]> | 2024-08-09 12:46:41 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-09 12:46:41 +0200 |
commit | 97df48a5d420072c1ed487b7d5306d1665e692db (patch) | |
tree | 9fd129a1b108828d02cf4baa6cbeef54be371afe /3p22.cpp | |
parent | 9b931cfed1551961c8bbb93b21051104c0c4c716 (diff) |
more exercises
Diffstat (limited to '3p22.cpp')
-rw-r--r-- | 3p22.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/3p22.cpp b/3p22.cpp new file mode 100644 index 0000000..488d85d --- /dev/null +++ b/3p22.cpp @@ -0,0 +1,42 @@ +#include <iostream> +#include <vector> +#include "sales_data.hpp" +#include "sales_item.hpp" + +/* + * + * 3.22 + * + * I'll be honest. I actually have no idea what i was supposed to do in this exercise. + * So i just made it so the program toupper's all the strings until a blank string is encountered + * Everything after the blank string is not processed or printed. + */ + +using std::string; +using std::cout; +using std::cin; +using std::cerr; +using std::clog; +using std::endl; +using std::vector; + +int main () { + + vector<string> text; + string s1; + while(getline(cin, s1)) { + text.push_back(s1); + } + + for(auto vi = text.begin() ; vi != text.end() && !vi->empty() ; vi++) { + for(auto &cc : *vi) { + cc = toupper(cc); + } + } + + for (auto it = text.cbegin() ; it != text.cend() && !it->empty() ; ++it) { + cout << *it << endl; + } + + return 0; +} |