ใใใใซใใใใใใฏใใ็จฎใฎๅจฏๆฅฝใงใใใๅใณใฎ็็ฑใงใใ ใใใฆใๅญไพๆไปฃใ็งใจไธ็ทใซ1ใๆใง้ใใ ใฎใงใ้ข็ฝใใชใใพใใใใใใใใผใใใฑใใใ็ฒๅพใงใใ็ขบ็ใฏใฉใใใใใงใใใ ใใใใใผใใใฑใใใฏใใใคใใใพใใ๏ผ
ๅญฆๆ กใงใฏใ่ชฐใใ็ ็ฉถไฝๆฅญ๏ผใพใใฏใใคใณใใงใฏใชใใใใฎใใใชใใจ๏ผใ่กใฃใใจใใฆใใๆฐๅผใๅฐใๅบใใใฐใฉใใๆใใชใฉใ่ฉฆใฟใใฎใ่ฆใใฆใใพใใ
ใใใใใณใณใใฅใผใฟใผใฎๅใซใใใ๏ผๆฐๅญฆใฎ่ฆณ็นใใ๏ผๆ้ฉใงใชใๆนๆณใง้ฒใใใจใใงใใใใจใๅคใใใใๆฐๅผใฎๅฐๅบใซ็ ฉใใใใชใใใจใซใใพใใใ
ใใฎ็ตๆใใใ้ใๅคๆใใพใใ:)
Perlใงใฎใใญใฐใฉใใณใฐใซไฝฟ็จใใใพใใ ใปใจใใฉใฎ่ณขๆใชใใญใฐใฉใใผใฏใๅฐใชใใจใDelphiใๅฐใชใใจใBasicใๅฐใชใใจใJavaScriptใชใฉใงใๅใใใจใๆฐๅใง็ฐกๅใซ็นฐใ่ฟใใใจใใงใใใจๆใใพใใ
ใใญใฐใฉใ ใฏใใปใผ100ไธใฎ็ตใฟๅใใ๏ผ989kใๆๅใฎใฉใใญใผใใฑใใ1001๏ผใ้้ใใพใใ
#!/usr/bin/perl
print "Content-Type: text/html\n\n" ;
$num = 1000;
$s = 0;
while ($num < 1000000) {
$ln = length($num);
$l6 = substr($num,$ln-6,1) if ($ln > 5);
$l5 = substr($num,$ln-5,1) if ($ln > 4);
$l4 = substr($num,$ln-4,1);
$l3 = substr($num,$ln-3,1);
$l2 = substr($num,$ln-2,1);
$l1 = substr($num,$ln-1,1);
if ($l6+$l5+$l4 eq $l3+$l2+$l1) {
print 0 x (6-$ln), "$num\n" ;
$s++;
}
$num++;
}
print " = $s" ;
* This source code was highlighted with Source Code Highlighter .
ใใฎ็ตๆใๅบๅฃใง55251ๆใฎใฉใใญใผใใฑใใใซ็ธๅฝใใ้้กใๅใๅใใพใใ ใ
ๅฐใไธธใใใจใ็ด18ๆใใจใฎใใฑใใใใใใใใผใใซใชใใพใใ
่ๅณๆทฑใใใจใซใๆฐๅญฆ็ใช่งฃๆฑบ็ญใๆขใใใจใซใใ้ๅธธใซ่ๅณๆทฑใในใใผใชใผใ่ฆใคใใพใใใใใใ่ชญใใใจใใๅงใใใพใใไปไบใใ10-15ๅๅฐใๆฐใๆฃใใใใใชใใใใใฏๅๅ้ข็ฝใใงใใ ๅใใใผใธใซใฏใใพใ ใฉใใญใผใใฑใใใซ้ขใใๅคใใฎ่ๅณๆทฑใใใฎใใใใพใใ
ใพใใใฆใฃใญใใใฃใขใงใฏใ ็ฐกๅใชๆ็ฒใ่ฆใใใจใใงใใพใใใใใใใผใใใฑใใใฎ่ฏใ็ญใ้ ๅธใใใใพใใ
ใฆใฃใญใใใฃใขใฎใใใซใ็ชๅท55252ใในใใผใชใผใซ็คบใใใฆใใพใใใใใฎใใใใฏใๆธใใฆใใๆ็นใงใฏใใใฑใใ็ชๅท000000ใฏๅญๅจใใชใใจๆใใพใใใ ่งฃ่ชฌใฏใใใฎใใใชใใฑใใใฎๅญๅจใฎ่จผๆ ใๆไพใใพใใ
็งใฏใใใในใฆใงไฝใ่จใใใใฎใงใใ๏ผ ใฏใใๅฎ้ใซใฏใ็นๅฅใชใใจใฏไฝใใใใพใใใ ไปไบไธญใซใชใฉใใฏในใใๅฟ ่ฆใใใๅ ดๅใฏใใฒใผใ ๏ผใฒใผใ ใ้คใ๏ผใ็ฒพ็ฅๆดปๅใซๅฝน็ซใคใใฎใใใใใ่ฆใคใใใใจใใงใใพใใ
ๅนธใใซ๏ผ
UPD๏ผใฟใคใใใไผ่ญฐใ๏ผ้้กใ1ใคใใค็ฐใชใ๏ผใใใณใๆ็ดใ๏ผ2ใ็ฐใชใ๏ผใฎใใฑใใใฎๆฐใใซใฆใณใใใพใใใ ใไผ่ญฐใ -109494ใใฑใใ ใใๆ็ดใ -106524ใใฑใใใ ใใฎ็ตๆใ็ด4ๆใซ1ๆใฎใใฑใใใ็งใใกใฎ็ๆดปใซๅฐใๅๅใใชๆฐๆใกใใใใใใฆใใพใใ