카타 8급 Find the Remainder

1 JavaScript[ | ]

function remainder(a, b){
  return a > b ? a % b : b % a;
}
function remainder(a, b){
  if(a>b) return a%b;
  return b%a;  
}

2 PHP[ | ]

function remainder($a, $b) {
  if( $a>$b ) return $b==0 ? null : $a%$b;
  return $a==0 ? null : $b%$a;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}