๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’Ž/C++

[C++] cin, cout ์‹œ๊ฐ„ ์ดˆ๊ณผ ๋ฌธ์ œ ํ•ด๊ฒฐ

by dar0m! 2020. 10. 16.
std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

or

ios_base :: sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

์œ„์˜ ์ฝ”๋“œ๋ฅผ main() ์•ˆ์— ์ ์–ด์ฃผ๋ฉด ๋œ๋‹ค. 0์ด๋“ , NULL์ด๋“  ๊ฐ™์€ ์˜๋ฏธ๋กœ ์“ฐ์ธ๋‹ค.

ํ•˜์ง€๋งŒ, ์ด ๋ฐฉ๋ฒ•์€ ๋งŒ๋Šฅ์€ ์•„๋‹ˆ๋ผ๊ณ  ํ•˜๋‹ˆ ๋ถˆ๊ฐ€ํ”ผํ•œ ๊ฒฝ์šฐ์—๋งŒ ์‚ฌ์šฉํ•˜๊ณ , ๋˜๋„๋ก scanf, printf๋ฅผ ์‚ฌ์šฉํ•˜์ž.

 

 

algospot.com :: ์ž์œ ๊ฒŒ์‹œํŒ: ๊ฐ ์–ธ์–ด๋ณ„ input method ๋น„๊ต

๊ฐ ์–ธ์–ด๋ณ„ input method ๋น„๊ต 13๊ฐœ์˜ ๋Œ“๊ธ€์ด ์žˆ์Šต๋‹ˆ๋‹ค.

algospot.com

 

 

cin ๊ณผ scanf ์— ๋Œ€ํ•ด์„œ

ACM-ICPC, Olympiad ๋ฌธ์ œ ์ •๋ฆฌ ๋ฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ณต๋ถ€์— ๋Œ€ํ•œ ๋ธ”๋กœ๊ทธ์ž…๋‹ˆ๋‹ค.

gooddaytocode.blogspot.com

 

๋Œ“๊ธ€