I've been using iostream for c++14 for a long time. Would it be more simple if I switched to stdio.h?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
I've been using iostream for c++14 for a long time. Would it be more simple if I switched to stdio.h?
Name |
---|
I first learned iostream, but I'm pretty sure stdio.h would be more simple
umm....
Why would stdio be simpler?
iostream is very easy to use, and it's easy to make it faster by removing synchronization with the stdio library and untying std::cin and std::cout. In almost all cases, using iostream with these 2 optimizations will let your code pass the TL.
There are maybe 4 or 5 problems that I've solved that actually didn't pass with iostream. One of them is Problem J of the Arab Collegiate Programming Contest from 2010. That problem has almost 80MB of input files. I think even stdio didn't stand a chance there. I recall writing my own thing to read the input in 1KB blocks or something.
I also recall this problem: http://mirror.codeforces.com/gym/101102/problem/J I couldn't get it to pass with iostream, but stdio passed just fine.
This is pretty rare in my opinion though. Don't take it too seriously, it's one data point.
iostream is more extensible ... If the data type is something different like pid_t ... You don't need to find the exact formate specifier for it. The disadvantage is that it is a little slower ... However there are ways to get around it.
P.S. — You can use cstdio ... It has all of the functions in stdio.h. I use cstdio when I use printf and scanf is C++ programs.