PetroChina-High Precision Division-java version

Source: Internet
Author: User

Question G: "High precision" high precision number divided by low precision number I time limit: 1 Sec memory limit: MB
Submitted by: Resolution: 15
Submitted State [Discussion Version]
Topic description Asura King gathered a large dark elements to display hidden magic, the magic will be in the surrounding space and time to create a hidden effect, of course, the effect of stealth depends on whether the dark elements are evenly distributed around the space-time, obviously this involves the programming of high-precision division. Considering the ability of the wolf to understand, Tabrets had to simplify the problem to: Enter a divisor (number of Bits ≤5000), enter a divisor (integer data range), output integer quotient, ignore decimal. Enter a total of two lines, the 1th behavior a numeric string, that is, the divisor, the 2nd behavior of an integer, that is, the divisor. Output output integer quotient, ignoring decimals. Sample input
205
Sample output
4 because it is easier to do it in Java, it is directly on the code.
Code:
ImportJava.math.BigInteger;ImportJava.util.Scanner; Public classMain { Public Static voidMain (string[] args) {Scanner sc=NewScanner (system.in); String St1=Sc.nextline (); String St2=Sc.nextline (); BigInteger B1=NewBigInteger (ST1); BigInteger B2=NewBigInteger (ST2);//b1.valueof (ST1);//b2.valueof (ST2);System.out.println (B1.divide (B2)); }}

PetroChina-High Precision Division-java version

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.