#include
#include
#include
#include
int main(int argc, char* argv[])
{
std::clock_t start;
dou
About 10 years ago, Scott Meyers tested the efficiency of iostream and scanf/printf. Depends on the compiler and environment, sometimes scanf/printf is 20% faster than iostream, sometimes even 200% faster. But iostream was never faster than scanf/printf. According to other two given examples, scanf/printf is still faster than iostream. However, Meyers said that "On a really useful program, there would be no differences." According to Google''s programming style([http://google-styleguide.googlecode.com/svn/trunk/cppguide.html]), streams should not be used except for logging. A replacement for iostream is to encapsule scanf/printf yourself.