Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2. //input
  3. $input = trim(fgets(STDIN));
  4. $token = '*';
  5. //calculations
  6. for ($x = 1; $x <= $input; $x++){
  7. for($y = 1; $y <= $input; $y++){
  8. if ($token == '*'){
  9. echo $token;
  10. $token = 'X';
  11. }
  12. else{
  13. echo $token;
  14. $token = '*';
  15. }
  16. }
  17. echo '!';
  18. echo PHP_EOL;
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement