diff options
author | Oskar <[email protected]> | 2024-08-07 22:39:51 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-07 22:39:51 +0200 |
commit | 9b931cfed1551961c8bbb93b21051104c0c4c716 (patch) | |
tree | 9232cc1246d35db36b0800e3d4af318f4e3905c9 /3p17.cpp | |
parent | 601e9571981ef44984e740ba71ce1648dbc223d3 (diff) |
more exercises
Diffstat (limited to '3p17.cpp')
-rw-r--r-- | 3p17.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/3p17.cpp b/3p17.cpp new file mode 100644 index 0000000..a2195c7 --- /dev/null +++ b/3p17.cpp @@ -0,0 +1,48 @@ +#include <iostream> +#include <vector> +#include <cctype> +#include "sales_data.hpp" +#include "sales_item.hpp" + +/* + * + * 3.17 + * + * + */ + +using std::string; +using std::cout; +using std::cin; +using std::cerr; +using std::clog; +using std::endl; +using std::vector; +int main () { + + string word; + vector<string> v_words; + while(cin >> word) { + v_words.push_back(word); + } + + for(auto &i : v_words) { + for(auto &c : i) { + c = toupper(c); + } + } + + decltype(v_words.size()) cnt = 0; + for(auto vww : v_words) { + if(cnt >= 8) { + cout << endl; + cnt = 1; + } else { + ++cnt; + } + cout << vww << " "; + } + + cout << endl; + return 0; +} |