末日流光


私信TA

用户名:user1542043226

访问量:2572

签 名:

等  级
排  名 4032
经  验 1710
参赛次数 2
文章发表 7
年  龄 20
在职情况 学生
学  校 武汉城市学院
专  业

  自我简介:

解题思路:用java太简单了,java有自带的高精除和高精取余的函数

参考代码:

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader=new Scanner(System.in);
		String x=reader.nextLine();//输入两个数
		String y=reader.nextLine();
		BigInteger one=new BigInteger(x);//用biginteger类读入数
		BigInteger two=new BigInteger(y);
		BigInteger result=new BigInteger("0");//定义结果
		//result=one.add(two);
		result=one.divide(two);//高精除
		System.out.println(result);
		result=one.mod(two);//高精取余
		System.out.println(result);//输出
 	}
}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区