浮点精确度,问鼎杯2017,代码还原"/>
PHP浮点精确度,问鼎杯2017,代码还原
题目描述:
用PHP本地实现以上网页背后的代码
环境:wampsever
代码
<?php
$flag="falg={something secret}";
echo "Can you tell me what year is this?<br>";
if(isset($_GET['year'])){$year=$_GET['year'];#echo $year;if($_GET['year']==='2017'){echo "Yes this year is 2017, but you can't input 7 in fact.";die();}elseif(strpos($_GET['year'],'0x')!==false){echo "Oh,I forgot to tell you that you can't input like 0x...or 0b...or...";die();#强制退出}elseif(strpos($_GET['year'],'0b')!==false){echo "Oh,I forgot to tell you that you can't input like 0x...or 0b...or...";die();#强制退出}elseif((float)$_GET['year']==2017){#echo '<br>';#echo gettype((float)$_GET['year']);#echo '<br>';#echo gettype(2017);#echo '<br>';echo "Congratulations";echo '<br>';echo "$flag";#echo (float)$_GET['year'];}else{echo "error";}}
else{echo "Year is not True!";
}?>
运行截图:
更多推荐
PHP浮点精确度,问鼎杯2017,代码还原
发布评论