View Code of Problem 132

import java.util.Scanner;
import java.math.BigDecimal;

public class Main
{
  	public static void main(String[] args)
        {
          	Scanner input=new Scanner(System.in);
          	while(input.hasnext())
                {
                  Bigdecimal a=input.nextBigdecimal();
                  Bigdecimal b=input.nextBigdecimal();
                  System.out.println(a.sutract(b).stripTrilingzero());
                }
        }
}
/*
Main.java:9: error: cannot find symbol
          	while(input.hasnext())
          	           ^
  symbol:   method hasnext()
  location: variable input of type Scanner
Main.java:11: error: cannot find symbol
                  Bigdecimal a=input.nextBigdecimal();
                  ^
  symbol:   class Bigdecimal
  location: class Main
Main.java:11: error: cannot find symbol
                  Bigdecimal a=input.nextBigdecimal();
                                    ^
  symbol:   method nextBigdecimal()
  location: variable input of type Scanner
Main.java:12: error: cannot find symbol
                  Bigdecimal b=input.nextBigdecimal();
                  ^
  symbol:   class Bigdecimal
  location: class Main
Main.java:12: error: cannot find symbol
                  Bigdecimal b=input.nextBigdecimal();
                                    ^
  symbol:   method nextBigdecimal()
  location: variable input of type Scanner
5 errors
*/

Double click to view unformatted code.


Back to problem 132