|
|
back to boardDifference in compilers? Posted by Ade 29 May 2013 22:09 The question is simple. So is my code. See below It gets AC in VC++2000. But why does it get WA#1 in gcc4.7.2 and gcc4.7.2-c++11, until I replace the while-scanf loop with the commented while-cin loop? Thanks. -- #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> int main() { std::vector<long long> v; long long t; while (std::scanf("%lld", &t) != EOF) { // while (std::cin >> t) { v.push_back(t); } for (int i=v.size()-1; i>=0; --i) { printf("%.5f\n", sqrt((double)(v[i]))); } } |
|
|