From 4be5163e2b514c6d0965b04f2b3c32fb22c1d6f2 Mon Sep 17 00:00:00 2001 From: IJNJJJCG Date: Mon, 2 Feb 2026 11:12:31 -0800 Subject: [PATCH 1/5] Division by 0 is not allowed --- main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a495fc94..36bb93c1 100644 --- a/main.cpp +++ b/main.cpp @@ -12,7 +12,11 @@ int main() std::cout << "Addition: " << x + y << std::endl; std::cout << "Subtraction: " << x - y << std::endl; std::cout << "Multiplication: " << x * y << std::endl; - std::cout << "Division: " << x / y << std::endl; + if (y == 0) { + std::cout << "Dividing by zero is not allowed.\n"; + } else { + std::cout << "Division: " << x / y << std::endl; + } std::cout << "Remainder: " << x % y << std::endl; std::cout << "Square Root: " << sqrt(x) << std::endl; std::cout << "Square: " << pow(x, y) << std::endl; From 02a8e81c8e06ce52ad34fef8791080cd28bbfae2 Mon Sep 17 00:00:00 2001 From: IJNJJJCG Date: Mon, 2 Feb 2026 11:28:28 -0800 Subject: [PATCH 2/5] took out stds for issue341 --- main.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/main.cpp b/main.cpp index 36bb93c1..9a226aef 100644 --- a/main.cpp +++ b/main.cpp @@ -1,25 +1,29 @@ #include #include +using std::endl; +using std::cin; +using std::cout; + int main() { - std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - std::cout << "Hi, please enter two whole numbers: "; + cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + cout << "Hi, please enter two whole numbers: "; int x,y; - std::cin >> x >> y; - std::cout << "Addition: " << x + y << std::endl; - std::cout << "Subtraction: " << x - y << std::endl; - std::cout << "Multiplication: " << x * y << std::endl; + cin >> x >> y; + cout << "Addition: " << x + y << endl; + cout << "Subtraction: " << x - y << endl; + cout << "Multiplication: " << x * y << endl; if (y == 0) { - std::cout << "Dividing by zero is not allowed.\n"; + cout << "Dividing by zero is not allowed.\n"; } else { - std::cout << "Division: " << x / y << std::endl; + cout << "Division: " << x / y << endl; } - std::cout << "Remainder: " << x % y << std::endl; - std::cout << "Square Root: " << sqrt(x) << std::endl; - std::cout << "Square: " << pow(x, y) << std::endl; + cout << "Remainder: " << x % y << endl; + cout << "Square Root: " << sqrt(x) << endl; + cout << "Square: " << pow(x, y) << endl; return 0; } From 9eae6a2873db1a6f19d1177538a2f9fe8d213de9 Mon Sep 17 00:00:00 2001 From: IJNJJJCG Date: Mon, 2 Feb 2026 13:41:49 -0800 Subject: [PATCH 3/5] Removed std:: --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 9a226aef..15851375 100644 --- a/main.cpp +++ b/main.cpp @@ -20,8 +20,8 @@ int main() cout << "Dividing by zero is not allowed.\n"; } else { cout << "Division: " << x / y << endl; + cout << "Remainder: " << x % y << endl; } - cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl; From f70fe987040eb45eec6f5f6e8ba2d41922308857 Mon Sep 17 00:00:00 2001 From: IJNJJJCG Date: Wed, 11 Feb 2026 11:51:03 -0800 Subject: [PATCH 4/5] Added action --- .github/workflows/actions.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 00000000..e69de29b From b234b0315f31d6984e4cfef92315cab50c6f465d Mon Sep 17 00:00:00 2001 From: IJNJJJCG Date: Wed, 11 Feb 2026 13:00:10 -0800 Subject: [PATCH 5/5] added branch --- .github/workflows/actions.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index e69de29b..c9cac7a8 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: g++ -std=c++17 main.cpp \ No newline at end of file