title: Middle Of Three Using Minimum Comparisons 1
signature: function middleOfThreeUsingMinimumComparisons1($a, $b, $c) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($a, $b, $c, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($a, $b, $c), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        43, 24, 7, 
        24));
      
      printf("TEST-1...%s\n",driver(
        76, 54, 66, 
        66));
      
      printf("TEST-2...%s\n",driver(
        57, 5, 40, 
        40));
      
      printf("TEST-3...%s\n",driver(
        10, 13, 4, 
        10));
      
      printf("TEST-4...%s\n",driver(
        59, 47, 56, 
        56));
      
      printf("TEST-5...%s\n",driver(
        92, 14, 50, 
        50));
      
      printf("TEST-6...%s\n",driver(
        49, 62, 65, 
        62));
      
      printf("TEST-7...%s\n",driver(
        16, 95, 12, 
        16));
      
      printf("TEST-8...%s\n",driver(
        33, 41, 90, 
        41));
      
      printf("TEST-9...%s\n",driver(
        66, 63, 46, 
        63));
      
  }
  
  main();
  ?>
source_py: def middle_of_three_using_minimum_comparisons_1(a, b, c):
      if (a > b):
          if (b > c):
              return b
          elif (a > c):
              return c
          else:
              return a
      elif (a > c):
          return a
      elif (b > c):
          return c
      else:
          return b
source_cpp: int middle_of_three_using_minimum_comparisons_1(int a, int b, int c) {
    if ( a > b ) {
      if ( b > c ) return b;
      else if ( a > c ) return c;
      else return a;
    }
    else {
      if ( a > c ) return a;
      else if ( b > c ) return c;
      else return b;
    }
  }