카타 8급 Fix the Bugs (Syntax) - My First Kata

PHP[ | ]

function my_first_kata($a, $b) {
  if ( (!is_int($a) and !is_float($a)) or (!is_int($b) and !is_float($b)) ){
    return false;
  } else {
    return $a % $b + $b % $a;
  }
}
function my_first_kata($a, $b) {
  if ( (!is_int($a) && !is_float($a)) || (!is_int($b) && !is_float($b)) ) {
    return false;
  } else {
    return $a % $b + $b % $a;
  }
}
function my_first_kata($a, $b) {
  return is_numeric($a) and is_numeric($b) ? ($a % $b) + ($b % $a) : false;
}
function my_first_kata($a, $b) {
  if (!is_numeric($a) or !is_numeric($b)) return false; 
  return ($a % $b) + ($b % $a);
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}