Created
April 23, 2015 10:27
-
-
Save Lotuashvili/9fc0ac47b46c68dfe25b to your computer and use it in GitHub Desktop.
მანქანის სანომრე ნიშნების შესაძლო ვარიანტები
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$letters = [ | |
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' | |
]; | |
$nums = [ | |
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | |
]; | |
$count = 0; | |
foreach ($letters as $l1) { | |
foreach ($letters as $l2) { | |
foreach ($letters as $l3) { | |
foreach ($letters as $l4) { | |
foreach($nums as $n1) { | |
foreach($nums as $n2) { | |
foreach($nums as $n3) { | |
$l1 = strtoupper($l1); | |
$l2 = strtoupper($l2); | |
$l3 = strtoupper($l3); | |
$l4 = strtoupper($l4); | |
$count++; | |
echo $l1.$l2.$n1.$n2.$n3.$l3.$l4." - "; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
echo $count; // 26 * 26 * 10 * 10 * 10 * 26 * 26 = 456,976,000 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment