diff --git a/calculator.cpp b/calculator.cpp index 23b2bb3..3c63184 100644 --- a/calculator.cpp +++ b/calculator.cpp @@ -4,3 +4,8 @@ int Calculator::Add (int a, int b) { return a + b; } + +int Calculator::Sub (int a, int b) +{ + return Add (a, -b); +} diff --git a/calculator.h b/calculator.h index 5813ec9..84ff414 100644 --- a/calculator.h +++ b/calculator.h @@ -5,6 +5,7 @@ class Calculator { public: int Add (int, int); + int Sub (int, int); }; #endif//CALCULATOR_H