Notes for code submission by hangdian ACM 1.When using JavaUse the class name Main
2. The possible causes for PE submission in Java are: 1) The most basic error is space. For example, check whether spaces are output at the end of each line. 2)
When submitting data in Java, pay attention to the method used for line feed output. out. use % N or \ r \ n as escape characters instead of \ n for formatting output of printf ().You can also use system. Out. println () to output a line feed. 3. it is best to use C/C ++ for computation with relatively accurate numbers. For the aspect of retaining decimals, use C's printf ("%. 2lf ", double_num) This formatting output function is relatively easy. In addition, you must pay attention to the following,
It is best to use double instead of floatIf float gets wa, And you think your result is correct, try changing the float type variable to double type and submit again. Some Questions of Hang DIAN are more difficult. If you use Java to retain decimals, you can use the method provided by the decimalformat class. For example, new decimalformat (". 00"). Format (435.257); // retain 2 decimal places, rounding, and output 435.26 .. 4. Empty lines between test cases 1) The most common problem is that you output a line break after the last use case. A better solution is to output a line break from the second use case. Next we will update the Java question... If you have any questions during Java submission, please reply to me. Thank you.