Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
第1引数に与えられた数xの最上位の桁以外の桁を0にした数を出力するPHPのプログラム。
<?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