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 | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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://codeforces.net/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.