Advertisement
NastySwipy

Exam - 19 March 2017 - Evening - 05 - Parallelepiped

Feb 17th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. $num = intval(readline());
  2. echo "+" . str_repeat('~', $num - 2) . '+' . str_repeat('.', $num * 2 + 1) . "\n";
  3. for ($i = 0; $i < $num * 2 + 1; $i++) {
  4.     echo '|' . str_repeat('.', $i) . "\\" . str_repeat('~', $num - 2) . "\\" . str_repeat('.', $num * 2 - $i) . "\n";
  5. }
  6. for ($i = 0; $i < $num * 2 + 1; $i++) {
  7.     echo str_repeat('.', $i) . '\\' . str_repeat('.', $num * 2 - $i) . '|' . str_repeat('~', $num - 2) . '|' . "\n";
  8. }
  9. echo str_repeat('.', $num * 2 + 1) . "+" . str_repeat('~', $num - 2) . '+';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement