KrasimiraGeorgieva

06. Letters Combinations, PB Exam 18 December 2016

Jun 27th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. // Programming Basics Exam - 18 December 2016 100/100
  4.  
  5. $first = ord(readline());
  6. $second = ord(readline());
  7. $third = ord(readline());
  8. $count = 0;
  9. for ($i = $first; $i <= $second; $i++) {
  10.     for ($i1 = $first; $i1 <= $second; $i1++) {
  11.         for ($i2 = $first; $i2 <= $second; $i2++) {
  12.             if ($i != $third && $i1 != $third && $i2 != $third) {
  13.                 print (chr($i) . chr($i1) . chr($i2) . " ");
  14.                 $count++;
  15.             }
  16.         }
  17.     }
  18. }
  19. echo "$count\n";
Advertisement
Add Comment
Please, Sign In to add comment