From 5d7cbd9d9e860bd1c9cf6a49d9bf26f97d56432a Mon Sep 17 00:00:00 2001 From: vonopr <vonopr@ya.ru> Date: Fri, 15 Apr 2022 17:02:24 +0300 Subject: [PATCH] Add source files --- exple-cmake-build/exple-expr.hpp | 12 ++++++++++++ exple-cmake-build/main.cpp | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 exple-cmake-build/exple-expr.hpp create mode 100644 exple-cmake-build/main.cpp diff --git a/exple-cmake-build/exple-expr.hpp b/exple-cmake-build/exple-expr.hpp new file mode 100644 index 0000000..895a1ee --- /dev/null +++ b/exple-cmake-build/exple-expr.hpp @@ -0,0 +1,12 @@ +#include "exple-add.h" +#include "exple-mul.h" + +namespace exple +{ + int add_and_mul( int a, int b, int c); +} + +int exple::add_and_mul( int a, int b, int c) +{ + return exple::mul(exple::add(a, b), c); +} diff --git a/exple-cmake-build/main.cpp b/exple-cmake-build/main.cpp new file mode 100644 index 0000000..acbafd3 --- /dev/null +++ b/exple-cmake-build/main.cpp @@ -0,0 +1,14 @@ +#include "exple-expr.hpp" + +#include <stdio.h> + +int main() +{ + + int a = 2; + int b = 3; + int c = 4; + printf("Multiplication of sum of %i and %i by %i is... %i", a, b, c, exple::add_and_mul(2, 3, 4)); + + return 0; +} -- GitLab