- <?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);
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/230920136091.html
来源: http://www.codesnippet.cn/detail/230920136091.html