From 5aac3c3f8bcfef0b2aad28d91d87b9ebf1d5e7df Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 28 Jul 2024 12:52:38 +0200 Subject: first commit --- 1p22.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 1p22.cpp (limited to '1p22.cpp') diff --git a/1p22.cpp b/1p22.cpp new file mode 100644 index 0000000..cd42a21 --- /dev/null +++ b/1p22.cpp @@ -0,0 +1,24 @@ +#include +#include "sales_item.hpp" + +/* + * Exercise 1.22 + * + * + * + */ + +int main () { + + Sales_item item1; + Sales_item sum; + if(std::cin >> sum) { + while(std::cin >> item1) { + sum += item1; + } + + std::cout << sum << std::endl; + } + + return 0; +} -- cgit v1.2.3