第一次用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));
}
}
}
posted on 2011-05-19 11:44
lee1r 閱讀(491)
評論(0) 編輯 收藏 引用 所屬分類:
題目分類:基礎/模擬