๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm/CodeUp ๊ธฐ์ดˆ 100์ œ

[์ฝ”๋“œ์—… ๊ธฐ์ดˆ 100์ œ-C์–ธ์–ด] 1001~1010๋ฒˆ

by ์ฝ”๋”ฉํ•˜๋Š” ๋ถ•์–ด 2023. 2. 27.
๋ฐ˜์‘ํ˜•

1001๋ฒˆ

#include <stdio.h>

int main() {
    printf("Hello");
    return 0;
}

 

1002๋ฒˆ

#include <stdio.h>

int main() {
    printf("Hello World");
    return 0;
}

 

1003๋ฒˆ

#include <stdio.h>

int main() {
    printf("Hello\nWorld");
    return 0;
}

์ค„์„ ๋ฐ”๊ฟ€ ์œ„์น˜์— \n ์„ ๋„ฃ์–ด์•ผ ํ•œ๋‹ค.

 

1004๋ฒˆ

#include <stdio.h>

int main() {
    printf("\'Hello\'");
    return 0;
}

๋ฌธ์žฅ ์•ˆ์— ' ๋ฅผ ํฌํ•จ์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„œ๋Š” ๊ทธ ์•ž์— \ ๋ฌธ์ž๋ฅผ ๋„ฃ์–ด์ค€๋‹ค.

 

1005๋ฒˆ

#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;
}

" ์•ž์— / ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.

๋ฌธ์žฅ ๋‚ด์—์„œ / ๋ฅผ ๋ฌธ์ž๋กœ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์œผ๋ฉด ์•ž์— / ๋ฅผ ํ•˜๋‚˜ ๋” ๋ถ™์—ฌ์„œ // ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

 

 

1010๋ฒˆ

#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    printf("%d", n);
    return 0;
}

%d ๋Š” int ์ž๋ฃŒํ˜•์˜ ์„œ์‹ ๋ฌธ์ž์ด๋‹ค. intํ˜• ์ •์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›๊ฒ ๋‹ค๋Š” ์˜๋ฏธ๋ฅผ ๊ฐ€์ง„๋‹ค.

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€