"카타 8급 Find the Remainder"의 두 판 사이의 차이

잔글 (봇: 카타 8급 PHP 분류 추가)
잔글 (봇: 자동으로 텍스트 교체 (-분류:PHP +))
26번째 줄: 26번째 줄:


[[분류:JavaScript]]
[[분류:JavaScript]]
[[분류:PHP]]
 
[[분류:카타 8급 PHP]]
[[분류:카타 8급 PHP]]

2019년 2월 3일 (일) 04:03 판

1 개요

카타 8급 C
# 🔗 문제 풀이

틀:카타 8급-2

2 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;  
}

3 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 }}