Algorithm/CodeUp ๊ธฐ์ด 100์
[์ฝ๋์ ๊ธฐ์ด 100์ -C์ธ์ด] 1001~1010๋ฒ
์ฝ๋ฉํ๋ ๋ถ์ด
2023. 2. 27. 20:48
๋ฐ์ํ
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ํ ์ ์๋ฅผ ์ ๋ ฅ๋ฐ๊ฒ ๋ค๋ ์๋ฏธ๋ฅผ ๊ฐ์ง๋ค.
๋ฐ์ํ