Skip to content

Commit

Permalink
02-max.cpp patch suggestion (#767)
Browse files Browse the repository at this point in the history
Added additional checks into main function to cover all the possibilities of 3 numbers sent to a function.
  • Loading branch information
mBialczak authored Dec 23, 2021
1 parent 4a95453 commit 6f549eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions 03-language-elements/tasks/02-max.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
// Write your function here

int main() {
std::cout << "max (1, 2, 3): " << max(1, 2, 3) << "\n";
std::cout << "max (2, 3, 1): " << max(2, 3, 1) << "\n";
std::cout << "max (3, 2, 1): " << max(3, 2, 1) << "\n";
std::cout << "max (1, 2, 3): " << max (1, 2, 3) << "\n";
std::cout << "max (1, 3, 2): " << max (1, 3, 2) << "\n";
std::cout << "max (2, 3, 1): " << max (2, 3, 1) << "\n";
std::cout << "max (2, 1, 3): " << max (2, 1, 3) << "\n";
std::cout << "max (3, 2, 1): " << max (3, 2, 1) << "\n";
std::cout << "max (3, 1, 2): " << max (3, 1, 2) << "\n";

return 0;
}

0 comments on commit 6f549eb

Please sign in to comment.