benchmark of 10,000,000 number's input
time ( yes 100 | ./a.out )
Optimization Flags | number |iostream| stdio
---------------------+------------+--------+------
CXXFLAGS="" | 100 | 9.830 | 3.664
CXXFLAGS="-O2 -Wall" | 100 | 10.006 | 3.831
CXXFLAGS="" | 1000000000 | 22.175 | 6.197
CXXFLAGS="-O2 -Wall" | 1000000000 | 10.835 | 6.461
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int a;
for(int i = 0; i < 10000000; ++i) {
cin >> a;
}
return 0;
}
#include <cstdio>
using namespace std;
int main(int argc, char **argv)
{
int a, i;
for(i = 0; i < 10000000; ++i) {
scanf("%d", &a);
}
return 0;
}