Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created May 13, 2020 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandanote-info/ea4fe52716a1ed52176b3db3fbe06692 to your computer and use it in GitHub Desktop.
Save pandanote-info/ea4fe52716a1ed52176b3db3fbe06692 to your computer and use it in GitHub Desktop.
第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