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

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

PHP中文网
Release: 2016-05-25 17:08:00
Original
1756 people have browsed it

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);
}
}
Copy after login
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template