Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //input
- $input = trim(fgets(STDIN));
- $token = '*';
- //calculations
- for ($x = 1; $x <= $input; $x++){
- for($y = 1; $y <= $input; $y++){
- if ($token == '*'){
- echo $token;
- $token = 'X';
- }
- else{
- echo $token;
- $token = '*';
- }
- }
- echo '!';
- echo PHP_EOL;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement