diff options
author | Oskar <[email protected]> | 2024-09-09 20:25:43 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-09-09 20:25:43 +0200 |
commit | 70878e5c5b4552def51082829032780c536dc59d (patch) | |
tree | 015253d567c12d90d6509ee052466217b3eacaa4 /6p27.cpp | |
parent | cc01160a3f0fdcb27eb931f67e85d783d0f5626d (diff) |
more
Diffstat (limited to '6p27.cpp')
-rw-r--r-- | 6p27.cpp | 25 |
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; +} |