Created
May 13, 2020 12:51
-
-
Save pandanote-info/ea4fe52716a1ed52176b3db3fbe06692 to your computer and use it in GitHub Desktop.
第1引数に与えられた数xの最上位の桁以外の桁を0にした数を出力するPHPのプログラム。
This file contains 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 | |
$x = intval($argv[1]); | |
$n = floor(log10($x)); | |
$y = floor($x/pow(10,$n))*pow(10,$n); | |
echo $y."\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment