diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1ddab56 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "**" + 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: make clean && make diff --git a/README.md b/README.md new file mode 100644 index 0000000..8487526 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +[![Build C++](https://github.com/stakacs2021/MyFirstExample/actions/workflows/build.yml/badge.svg)](https://github.com/stakacs2021/MyFirstExample/actions/workflows/build.yml) +testing workflows diff --git a/main.cpp b/main.cpp index a495fc9..7e04de5 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include #include +using namespace std; int main() { std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; @@ -8,14 +9,12 @@ int main() 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; - 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; - + cin >> x >> y; + cout << x << "+" << y << "=" << x + y << endl; + cout << x << "-" << y << "=" << x - y << endl; + cout << x << "*" << y << "=" << x * y << endl; + cout << x << "/" << y << "=" << x / y << " with a remainder of " << x % y << endl; + cout << "Square Root of " << x << " is " << sqrt(x) << endl; + cout << "Square Root of " << y << " is " << sqrt(y) << endl; return 0; }