- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
java练习_大数运算_BigInteger
/**
* 大数运算
* BigInteger
* 求91的92次方
* 求它除以100的余数
* 大数运算Biginteger类的方法调用
*/
package com.test1;
import java.math.*;
import java.math.BigInteger;
public class test100 {
/**
* @param args
*/
static BigInteger k=BigInteger.valueOf(1);
static BigInteger j=BigInteger.valueOf(91);
static BigInteger n;
BigDecimal l=new BigDecimal(100);
static BigInteger m=new BigInteger(100);
public static void main(String[] args) {
// TODO Auto-generated method stub
// k=BigInteger.valueOf(1);
// k=new BigInteger(1);
for(int i=1;i=92;i++){
k=k.multiply(j);
System.out.println(k.toString());
// n=k.remainder(m);
n=k.remainder(m);
System.out.println(n.toString());
}
}
}
//java大数运算Biginteger类的方法调用
//以下代码与本练习没有必要关系,可以删除
class BigIntegerGet
{
public String getAdd(String Str1,String Str2){
String Str3=new String();
BigInteger BigInt1=new BigInteger(Str1);
BigInteger BigInt2=new BigInteger(Str2);
BigInt1=BigInt1.add(BigInt2);//加
Str3=BigInt1.toString();
return Str3;
}
public String getSubtract(String Str1,String Str2){
String Str3=new String();
BigInteger BigInt1=new BigInteger(Str1);
BigInteger BigInt2=new BigInteger(Str2);
BigInt1=BigInt1.subtract(BigInt2);//减
Str3=BigInt1.toString();
return Str3;
}
public String getMultiply(String Str1,String Str2){
String Str3=new String();
BigInteger BigInt1=new BigInteger(Str1);
BigInteger BigInt2=new BigInteger(Str2);
BigInt1=BigInt1.multiply(BigInt2);//乘
Str3=BigInt1.toString();
return Str3;
}
public String getDivide(String Str1,String Str2){
String Str3=new String();
BigInteger BigInt1=new BigInteger(Str1);
BigInteger BigInt2=new BigInteger(Str2);
BigInt1=BigInt1.divide(BigInt2);//除
Str3=BigInt1.toString();
return Str3;
}
public String getRemainder(String Str1
您可能关注的文档
- (五笔快学)98五笔卡片.doc
- (二下)26.蜜蜂引路.ppt
- (人教版)七年级下册数学相交线课件4.ppt
- (二上)6.表内乘法(二)(4.9的乘法口诀).ppt
- (二上)4.表内乘法(一)(3.乘加乘减).ppt
- (广东卷)2013年普通高等学校招生全国统一考试.doc
- (水寨) 对“霁虹桥与摩崖石刻”保护修复的思考2.doc
- (特别报道)华山上的摩崖石刻.doc
- (用)除数是两位数的除法复习.ppt
- (新)建立标准化代维班组规范.doc
- 2025年低空经济无人机保险与风险防控研究报告.docx
- 南京理工大学泰州科技学院《英语教学法》2023-2024学年第一学期期末试卷.doc
- 新能源行业人才队伍建设与发展报告:2025年技术创新与人才流动趋势分析.docx
- 2025年煤炭破碎除尘风量计算题库(附答案).docx
- 2025年事业单位工勤技能-通用版-公路养护工二级(技师)历年参考题库(含答案).docx
- 2025年工业互联网平台设备能耗对标管理分析应用研究报告.docx
- 2025年无人机技术专利布局国际比较报告.docx
- 陕西职业技术学院《社会调查与统计》2023-2024学年第一学期期末试卷.doc
- 6-某科技公司职族管理手册.docx
- 2025年智能巡检机器人助力港口起重机减员增效报告.docx
原创力文档


文档评论(0)