From cb72c34ff23c8c6c2e6b8376d1cf8a5ca5b9becb Mon Sep 17 00:00:00 2001 From: Oskar Date: Tue, 6 Aug 2024 18:48:35 +0200 Subject: more exercises --- 3p10.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 3p10.cpp (limited to '3p10.cpp') diff --git a/3p10.cpp b/3p10.cpp new file mode 100644 index 0000000..4863abf --- /dev/null +++ b/3p10.cpp @@ -0,0 +1,34 @@ +#include +#include "sales_data.hpp" +#include "sales_item.hpp" + +/* + * + * 3.10 + * + * Not sure if i was supposed to support full sentences with whitespace but i decided to do that because it is a bit nicer. + */ + +using std::string; +using std::cout; +using std::cin; +using std::cerr; +using std::clog; +using std::endl; +int main () { + + string Phrase; + if(getline(cin, Phrase)) { + for(auto &c : Phrase) { + if(!ispunct(c)) { + cout << c; + } + } + cout << endl; + } else { + cout << "Error!" << endl; + return -1; + } + + return 0; +} -- cgit v1.2.3