joj 1920:Jojer

 1920: Jojer


ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE
3s 8192K 784 242 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 


Submit / Problem List / Status / Discuss

 
最近真是愈发懒了...
大数的题目,如果真正C/C++写的话还是挺麻烦的...
于是,无耻地用Java水吧,阿弥陀佛...
 1 import java.io.*;
 2 import java.util.*;
 3 import java.math.*;
 4 
 5 public class Main
 6 {
 7     public static void main(String args[])
 8     {
 9         Scanner cin = new Scanner(new BufferedInputStream(System.in)); 
10         
11         while (cin.hasNext()) 
12         {
13             BigInteger a = BigInteger.valueOf(100); 
14             BigInteger b = BigInteger.valueOf(100); 
15         
16             a = cin.nextBigInteger();
17             b = cin.nextBigInteger();
18         
19             BigInteger c = a.add(b);
20             System.out.println(c);
21         
22             c = a.subtract(b);
23             System.out.println(c);
24         
25             c = a.multiply(b);
26             System.out.println(c);
27         
28             c = a.divide(b);
29             System.out.println(c);
30         }
31     }
32 }

 

posted @ 2012-05-04 22:20  漂木  阅读(324)  评论(0编辑  收藏  举报