You get a bonus - 1 coin for daily activity. Now you have 1 coin

php text direction from top to bottom Lilichka

Lecture



  php text direction from top to bottom Lilichka
Lilichka
How do you. maybe you know, in some languages ​​of the world it is customary to write the text not from left to right,
and swirl down. Let's write a program that makes a similar “turn” of the text.

The task:
Given a text consisting of several lines. Write a program that displays this text vertically (see example).

Smoke tobacco air eaten.
Room -
head in kruchenyhovskom hell.
Remember -

outside this window
first
Your hands, freaked out, stroked.
Today you sit here
heart in the gland.
Day still -
expel,
maybe scolding.
In the muddy front for a long time does not fit
shaky arm in the sleeve.


Tip for the silly
it is possible to break the CODE into lines by the symbol \ n after that we cycle through the lines,
and in it a nested loop over all the characters and output them
  Д | К | г | В | з | в | р | С | с | Д | в | м |  | with | 
s | o | l | c | a | n | u | e | e | e | s | o | | l |
m | m | a | p | | e | k | r | p | n | g | f | | o |
| n | in | o | e | p | and | o | d | b | o | e | | m |
t | a | a | m | t | v | | d | q | | n | t | | a |
a | t | | n | and | s | t | n | e | e | and | | | n |
b | a | to | and | m | e | to | i | | u | w | b | | n |
a | | | | | | o | | in | e | b | s | | a |
h | - | k | - | o | | and | with | | |, | t | | I |
n | | p | | to | |, | and | x | - | | ь | | |
s | | at | | n | | | e | e | | |, | | d |
th | | h | | o | | and | and | l | | | | | p |
| | e | | m | | c | w | e | | | and | | o |
in | | n | | | | s | s | s | | | h | | Well |
about | | s | | | | t | | e | | | p | | ь |
s | | x | | | | u | in |. | | | at | | yu |
d | | o | | | | n | o | | | | r | | |
at | | in | | | | l | t | | | | a | | p |
x | | with | | | | e |, | | | | in | | at |
| | to | | | | n | | | | |. | | to |
in | | o | | | | n | | | | | | | a |
s | | m | | | | s | | | | | | | |
e | | | | | | y | | | | | | | in |
l | | a | | | |, | | | | | | | |
. | | d | | | | | | | | | | | p |
| | e | | | | r | | | | | | | at |
| |. | | | | l | | | | | | | to |
| | | | | | a | | | | | | | a |
| | | | | | d | | | | | | | in |
| | | | | | and | | | | | | |. |
| | | | | | l | | | | | | | |
| | | | | |. | | | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |

Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Running server side scripts using PHP as an example (LAMP)

Terms: Running server side scripts using PHP as an example (LAMP)