From 9b931cfed1551961c8bbb93b21051104c0c4c716 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 7 Aug 2024 22:39:51 +0200 Subject: more exercises --- 3p17.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 3p17.cpp (limited to '3p17.cpp') 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 +#include +#include +#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 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; +} -- cgit v1.2.3