A/b problem

Source: Internet
Author: User

Describe

Do a+b problem,a/b problem is not a problem!

 
Input
each set of test sample line, first a number a, one or more spaces in the middle, then a symbol (/or%), then another space, followed by a number b,a may be very long, B is an int range number.
Output
output results.
Sample input
110/10099% 102147483647/21474836472147483646 2147483647
Sample output
1912147483646

1 ImportJava.math.BigInteger;2 ImportJava.util.Scanner;3 4  Public classMain {5      Public Static voidMain (string[] args) {6Scanner scanner=NewScanner (system.in);7 BigInteger A;8 String sign;9 BigInteger B;Ten          One          while(Scanner.hasnext ()) { AA=Scanner.nextbiginteger (); -sign=Scanner.next (); -b=Scanner.nextbiginteger (); the              -             if(Sign.compareto ("/") ==0) - System.out.println (A.divide (b)); -             Else + System.out.println (A.remainder (b)); -         } +     } A } at              -             

A/b problem

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.