1920: Jojer JAVA大数

1920: Jojer

Result TIME Limit MEMORY Limit Run Times AC Times JUDGE
3s 8192K 707 223 Standard

Mr Jojer is a teacher, and he is crazy in programming, he wants the computer to do every thing for him, one day, one of his colleague Mr NEtiger asks him to write a procedure for him. But Mr Jojer has another difficult problem, so he asks you to do it for him. Do you want a try? Ok, let's begin!

There are two numbers for the pupils to operate, Mr NEtiger wants to know the answers of plus, minus, multiply, divide,so he can check the answers which the pupils hand in.

The input contain two numbers, you should output the answers in the order of plus, minus, multiply, divide. You may assume that they are dividable and no remainder.

Is it easy? But you should know the numbers may as long as 50 digits.

Sample Input

10 2
15 3

Sample Output

12
8
20
5
18
12
45
5

 

This problem is used for contest: 60  

 

 

 

import java.io.*;

import java.util.*;

import java.math.*;

import java.text.*;

public class Main {

  public static void main(String[] args) {

   Scanner cin =new Scanner (System.in);

   BigInteger a,b;

   while(cin.hasNext() )

   {

      a=cin.nextBigInteger() ;

      b=cin.nextBigInteger() ;

      System.out.println(a.add(b));

      System.out.println(a.subtract(b));

      System.out.println(a.multiply(b));

      System.out.println(a.divide(b));

   }

  }

 

你可能感兴趣的:(java,String,input,import,output,Numbers)