Last active
December 22, 2015 04:26
-
-
Save hanafiah/268efe9cf9a9792ec707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function GCD($a, $b) | |
{ | |
while ( $b != 0) | |
{ | |
$remainder = $a % $b; | |
$a = $b; | |
$b = $remainder; | |
} | |
return abs ($a); | |
} | |
$h = 6000; | |
$w = 400; | |
$gcd = GCD($h,$w); | |
echo $h/$gcd.':'.$w/$gcd; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment