Source code issue

Hi, I have difficulty with managing a source code on gitlab.

Once I code as above and pushed it to the gitlab.com, I got the result like this:

Whole source code became a single line. Is there anything that I am doing wrong?

Thanks in advance.