summaryrefslogtreecommitdiff
path: root/6p27.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-09-09 20:25:43 +0200
committerOskar <[email protected]>2024-09-09 20:25:43 +0200
commit70878e5c5b4552def51082829032780c536dc59d (patch)
tree015253d567c12d90d6509ee052466217b3eacaa4 /6p27.cpp
parentcc01160a3f0fdcb27eb931f67e85d783d0f5626d (diff)
more
Diffstat (limited to '6p27.cpp')
-rw-r--r--6p27.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/6p27.cpp b/6p27.cpp
new file mode 100644
index 0000000..2cc6f99
--- /dev/null
+++ b/6p27.cpp
@@ -0,0 +1,25 @@
+#include <iostream>
+
+/*
+ *
+ * 6.27
+ *
+ *
+ */
+
+void initlisttest(std::initializer_list<int> list) {
+
+ int sum = 0;
+ for(auto a : list) {
+ sum += a;
+ }
+ std::cout << sum << std::endl;
+}
+
+int main () {
+
+ initlisttest({10, 10, 10, 10, 10, 10});
+ initlisttest({10, 1});
+ initlisttest({2, 2, 2});
+ return 0;
+}