Considerations when submitting code for hangdian OJ

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.