In competitive programming, it is common for many programmers to use scanf()
and printf()
in C ++ code instead of using cin
and cout
.
And I've even seen problems that result in a Time Limit Exceeded (TLE) when used cin
and cout
, but run within time when scanf()
is used printf()
, implementing the same idea in the algorithms.
Then there is the question, scanf()
is always faster than cin
, will it depend on the case or cin
is faster?