๐Ÿ’ป/ํ”„๋กœ๊ทธ๋ž˜๋ฐ 26

[C, C++] scanf์˜ EOF ๋ฐ˜ํ™˜

๋ฌธ์ œ 10951๋ฒˆ: A+B - 4 ๋‘ ์ •์ˆ˜ A์™€ B๋ฅผ ์ž…๋ ฅ๋ฐ›์€ ๋‹ค์Œ, A+B๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. www.acmicpc.net ํ’€์ด #include int main() { int A, B; while (true) { if (scanf("%d %d", &A, &B) == EOF) return 0; printf("%d\n", A + B); } return 0; } ์ž˜๋ณด๋ฉด ๋ฐ˜๋ณต๋ฌธ์˜ ์ข…๋ฃŒ์กฐ๊ฑด์ด ์ฃผ์–ด์ ธ ์žˆ์ง€ ์•Š๋‹ค. ์ด๋Ÿด ๊ฒฝ์šฐ ์–ด์ฐจํ”ผ ๋ฐฑ์ค€์—์„œ ์ฑ„์ ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ํ…Œ์ŠคํŠธ์ผ€์ด์Šค์—๋„ ๋์ด ์žˆ์„ ๊ฒƒ์ด๋‹ค. scanf ํ•จ์ˆ˜๊ฐ€ ์ž…๋ ฅ ํŒŒ์ผ์˜ ๋์„ ๋งŒ๋‚˜๋ฉด EOF(End Of File)๋ฅผ ๋ฐ˜ํ™˜ํ•จ์„ ์ด์šฉํ•˜์—ฌ ๋ฐ˜๋ณต๋ฌธ์„ ํƒˆ์ถœํ•ด์ฃผ์ž.

[C, C++] cout์˜ ์ถœ๋ ฅ ์†๋„ ๊ฐœ์„ 

๋ฌธ์ œ 15552๋ฒˆ: ๋น ๋ฅธ A+B ์ฒซ ์ค„์— ํ…Œ์ŠคํŠธ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ T๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. T๋Š” ์ตœ๋Œ€ 1,000,000์ด๋‹ค. ๋‹ค์Œ T์ค„์—๋Š” ๊ฐ๊ฐ ๋‘ ์ •์ˆ˜ A์™€ B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. A์™€ B๋Š” 1 ์ด์ƒ, 1,000 ์ดํ•˜์ด๋‹ค. www.acmicpc.net ํ’€์ด ruhz3/CodingTest To prepare for coding test. Contribute to ruhz3/CodingTest development by creating an account on GitHub. github.com #include using namespace std; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int T; cin >> T; int A, B; for (int i = ..

[ํŒŒ์ด์ฌ] f-string, ๋ฌธ์ž์—ด ๊ธธ์ด ๊ณ ์ •

์ฐธ๊ณ  python 3์—์„œ๋Š” f-string์ด ๊ฐ‘์ด๋‹ค. f-string ์‚ฌ์šฉ ๋ฐฉ๋ฒ•๊ณผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ์ด์œ  Python ์—์„œ ๋ฌธ์ž์—ด์„ ๋‹ค๋ฃฐ ๋•Œ๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ์‹์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋Œ€๋ถ€๋ถ„์€ ์•„๋งˆ๋„ ๊ธฐ์กด python 2์—์„œ ์ง€์›ํ•˜๋˜ %-formatting ๋ฐฉ์‹๊ณผ Format string syntax ์ธ str.fo.. bluese05.tistory.com ๊ฐ€๋…์„ฑ์ด ์ข‹๋‹ค ๋ณ€์ˆ˜์˜ type์— ๋Œ€ํ•œ ์ž์œ ๋„๊ฐ€ ๋” ๋†’๋‹ค. ๊ถ๊ธˆํ–ˆ๋˜ ์ฝ”๋“œ username_header = f"{len(username):

[ํŒŒ์ด์ฌ] ๋‹จ์ถ•ํ‚ค ์ •๋ฆฌ

https://kgu0724.tistory.com/95 Pycharm ๋‹จ์ถ•ํ‚ค ์ •๋ฆฌ (ํŽŒ) Editing Ctrl + Space : Basic code completion (the name of any class,method or variable) Ctrl + Shift + Space : Smart code completion (filters the list of methodsand variables by expected type) Ctrl.. kgu0724.tistory.com Ctrl + Alt + T : ๋‹ค์Œ์œผ๋กœ ์ฝ”๋“œ ๊ฐ์‹ธ๊ธฐ… (if..else, try..catch, for,synchronized, etc.) Ctrl + W : ๊ฐ€์žฅ ์•ˆ์ชฝ์˜ ๊ด„ํ˜ธ๋ถ€ํ„ฐ ์„ ํƒ(์ ์  ํ™•์žฅ ๋œ๋‹ค.) Ctrl + Alt + I..

[ํŒŒ์ด์ฌ] ์ฝ”๋“œ์ ‘๊ธฐ(Code Folding)

https://www.jetbrains.com/help/pycharm/2016.1/code-folding.html#using_folding_comments PyCharm 2016.1 Help :: Code Folding Code Folding On this page: Basics You can collapse (fold) code fragments reducing them to a single visible line. In this way, you can hide the details that, at the moment, seem unimportant. If and when necessary, the folded code fragments can be expanded ( www.jetbrains.com ..