mstoyanov7

03. Smallest of Three Numbers

Apr 1st, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int getMin(int a, int b) {
  7. if (a < b) {
  8. return a;
  9. }
  10. return b;
  11. }
  12.  
  13.  
  14. int main() {
  15.  
  16. int a, b, c;
  17. cin >> a >> b >> c;
  18.  
  19.  
  20. cout << getMin(getMin(a, b),c);
  21.  
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment