Brijesh1in's blog

By Brijesh1in, history, 8 years ago, In English

I have seen that mostly great programmers use scanf in C++ while they can use cin with ios::sync_with_stdio(false); cin.tie(NULL); I want to know why??

Sorry because I don't know how to put things into a block .... Thanks in advance .....

  • Vote: I like it
  • +11
  • Vote: I do not like it

»
8 years ago, hide # |
 
Vote: I like it -19 Vote: I do not like it

People use scanf because when the amount of test case are small the speed of scanf is still faster, but when the amount exceeds 1e7 cin overtakes scanf

»
8 years ago, hide # |
Rev. 3  
Vote: I like it +37 Vote: I do not like it

scanf / printf more powerful than cin / cout because it use regular expressions.

Examples

UPD: u can easy use scanf / printf in this problem, my solution with scanf, printf, sprintf

»
8 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

when you use sync_with_stdio you can no longer use some convenient and fast ways of input / output