함수 divmod()


1 PHP[ | ]

PHP
Copy
function divmod( $a, $b ) { return [(int)($a/$b), $a%$b]; }
print_r( divmod(13, 5) );
# Array
# (
#     [0] => 2
#     [1] => 3
# )

2 Python[ | ]

Python
Copy
print( divmod(13, 5) )
# (2, 3)

3 같이 보기[ | ]