UVa 10494 If We Were a Child Again

UVa 10494 If We Were a Child Again
第一次用Java做题。
在OJ上提交Java题目主类名为Main。
以下是我的代码:
import  java.util.Scanner;
import  java.math.BigInteger;

public   class  Main
{
    
public   static   void  main(String[] args)
    {
        Scanner cin
= new  Scanner(System.in);
        
while (cin.hasNext())
        {
            BigInteger a,b;
            String c;
            a
= cin.nextBigInteger();
            c
= cin.next();
            b
= cin.nextBigInteger();

            
if (c.charAt( 0 ) == ' / ' )
                System.out.println(a.divide(b));
            
else
                System.out.println(a.mod(b));
        }
    }
}

你可能感兴趣的:(UVa 10494 If We Were a Child Again)