|
|
вернуться в форумWhat's wrong with output using "cout"? When I changed it on "printf", I got AC I thought, that these 2 codes are equal: cout.precision(2); cout.setf(ios::showpoint || ios::fixed); cout<<res<<'\n'; OR printf("%0.2f",res); Can anybody explain it me. Maybe, something wrong with GNU C++? I had even a much BIGGER problem Well, it does not work always :)) I do not know why, but the truth is that on different PCs these do not work identically....... a BIG BUG But I had even a bigger problem. I submitted a solution of problem 1176 (in fact, I submitted four different solutions over 30 times ;) ), but I always got TL exceeded. I always used cin/cout. I changed cin to scanf() and cout to printf() and all was OK -> my solution got AC, having in mind that 1. When using CIN/COUT it worked over the time limit i.e. more than 2 secs 2. When I changed them to scanf/printf i got AC and my program worked 0.9 secs............ So-> I advice you -> always use printf, scanf and all the C stuff :)) C++ input/output has lots of bugs, and as it seems, it si quite slow............. |
|
|