| 
| Идёт турнир! |  | В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания. 
 |  
 | 
| imesecan | 08.апр.2011 в 16:03:10 |  |  | 0 | Use printf command. Using printf you can decide the number of floating point digits. printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
 %f  means: Print a floating point number.
 %4.2f  means: Print the floating point number (the first number after the double quotation) totally in for space. and 2 digits after the floating point.
 
 In our case you should use
 printf ("%0.1f", res);
 Then it will print res with 1 digit after the floating point. It says 0 there that means the total space is not important print the number as it's with one digit after the floating point.
 
 
 |  | imesecan | 24.фев.2012 в 07:28:51 |  |  | 1 | sorry, float precision is not enough, it's better to use "double".
 
 
 |  
 |