Home >php教程 >PHP源码 >PHP 菜鸟尝试解决“易语言难题”

PHP 菜鸟尝试解决“易语言难题”

PHP中文网
PHP中文网Original
2016-05-25 17:08:001749browse

PHP 菜鸟尝试解决“易语言难题”

<?php
function check($i) {
$arr = array(0=>1);
$temp = array($i, $i*2, $i*3);
for($j = 0; $j < 3; $j++) {
$arr[$temp[$j]%10] = 1;
$arr[floor($temp[$j]/100)] = 1;
$arr[floor($temp[$j]/10)%10] = 1;
}

return count($arr) == 10;
}

for($i = 123; $i < 330; $i++) {
if(check($i)) {
printf("%d, %d, %d \n", $i, $i*2, $i*3);
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: php防御XSS攻击Next article:简单好用的PHP验证码类