From b37ecb493ee5f5087fc8dcf26d5ae73ab0bc5002 Mon Sep 17 00:00:00 2001 From: Wingleszy Date: Thu, 14 May 2026 02:18:21 +0300 Subject: [PATCH] fix structure errors --- project_cpp/functions.cpp | 19 +++++++++++++++++++ project_cpp/main.cpp | 25 +++++++++++++------------ tests/tests.cpp | 2 +- 3 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 project_cpp/functions.cpp diff --git a/project_cpp/functions.cpp b/project_cpp/functions.cpp new file mode 100644 index 0000000..e2d5bb9 --- /dev/null +++ b/project_cpp/functions.cpp @@ -0,0 +1,19 @@ +#include +#include + +int add (int a, int b) { + return a + b; +} + + +int multiple (int a, int b) { + return a * b; +} + +int substraction (int a, int b) { + return a - b; +} + +int devide (int a, int b) { + return round(a / b); +} \ No newline at end of file diff --git a/project_cpp/main.cpp b/project_cpp/main.cpp index f86ff6f..879fbb6 100644 --- a/project_cpp/main.cpp +++ b/project_cpp/main.cpp @@ -1,22 +1,23 @@ #include #include +#include "./functions.cpp" -int add (int a, int b) { - return a + b; -} +// int add (int a, int b) { +// return a + b; +// } -int multiple (int a, int b) { - return a * b; -} +// int multiple (int a, int b) { +// return a * b; +// } -int substraction (int a, int b) { - return a - b; -} +// int substraction (int a, int b) { +// return a - b; +// } -int devide (int a, int b) { - return round(a / b); -} +// int devide (int a, int b) { +// return round(a / b); +// } int main () { std::cout << "ADD: " << add(4, 5) << "\n"; diff --git a/tests/tests.cpp b/tests/tests.cpp index 6d230b7..ccbf0c5 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -1,5 +1,5 @@ #include -#include "../project_cpp/main.cpp" +#include "../project_cpp/functions.cpp" int add_test() { if(add(4, 5) != 9) {