CodeUp C언어 기초 100제 [기초 - 출력] 1001~1008

jychan99·2021년 8월 17일
0
post-thumbnail

1001

#include <stdio.h>
int main()
{
  printf("Hello");
  return 0;
}

1002

#include <stdio.h>
int main()
{
    printf("Hello World");
    return 0;
}

1003
백슬래시와 \ 는 같은 표기로 글씨체에 따라 달라짐
\n는 printf문에서 줄을 바꿔주는 역할을 함

#include <stdio.h>
int main()
{
    printf("Hello\nWorld");
    return 0;
}

1004
printf에서 작은따옴표를 그냥쓰면 오류가 나서 '를 직접표기해주려면 \'로 써줘야 함

#include <stdio.h>
main()
{
    printf("\'Hello\'");
    return 0;
}

1005
4번 문제와 동일하게 큰따옴표도 직접표기하려면 \"로 써줘야함

#include <stdio.h>
int main()
{
    printf("\"Hello World\"");
    return 0;
}

1006
%를 사용할때에도 따옴표와 같이 그냥쓰면 오류가 나기 때문에 %%로 써줌(\%아님)

#include <stdio.h>
int main()
    printf("\"!@#$%%^&*()\"");
    return 0;
}

1007
\를 사용할떄도 따옴표,%와 같이 그냥쓰면 오류나서 \로 써줌

#include <stdio.h>
int main()
{
    printf("\"C:\\Download\\hello.cpp\"");
    return 0;
}

1008
주어진 유니코드로 표를 만드는 문제 가로 세로조합해서 만듦
솔직히 쓸데가 있을까 싶은데, 유니코드로 특수문자를 나타낼수 있다~ 하는 내용인 것 같음

#include <stdio.h>
int main()
{
    printf("\u250C\u252C\u2510\n\u251C\u253C\u2524\n\u2514\u2534\u2518");
    return 0;
}
profile
내가 지금 두려워 하고 있는 일이 바로 내가 지금 해야 할 일이다. 🐍

0개의 댓글

관련 채용 정보