博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UVA - 10494 If We Were a Child Again
阅读量:4315 次
发布时间:2019-06-06

本文共 976 字,大约阅读时间需要 3 分钟。

 

用java写的大数基本操作,java要求的格式比较严谨。

1 import java.util.*; 2 import java.math.*; 3 public class Main { 4         public static void main(String args[]) { 5             Scanner cin = new Scanner(System.in); 6              7             BigInteger a,b,ans; 8             String c; 9             b = BigInteger.valueOf(1);10             a = BigInteger.valueOf(1);11         //    BigInteger zero=new BigInteger("0");12             13             while(cin.hasNext())14             {15                 a=cin.nextBigInteger();16                 c=cin.next();17                 b=cin.nextBigInteger();18                 if(c.equals("/"))19                     ans = a.divide(b);20                 else21                     ans=a.mod(b);22                 System.out.println(ans);23             }24             return ;25     }26     27 }
View Code

 

还有一些关于java的基本操作,参见大佬博客:https://blog.csdn.net/Akatsuki__Itachi/article/details/81152232

转载于:https://www.cnblogs.com/daybreaking/p/9381362.html

你可能感兴趣的文章
从Vue.js窥探前端行业
查看>>
学习进度
查看>>
poj3368 RMQ
查看>>
“此人不存在”
查看>>
github.com加速节点
查看>>
解密zend-PHP凤凰源码程序
查看>>
python3 序列分片记录
查看>>
Atitit.git的存储结构and 追踪
查看>>
atitit 读书与获取知识资料的attilax的总结.docx
查看>>
B站 React教程笔记day2(3)React-Redux
查看>>
找了一个api管理工具
查看>>
Part 2 - Fundamentals(4-10)
查看>>
使用Postmark测试后端存储性能
查看>>
NSTextView 文字链接的定制化
查看>>
第五天站立会议内容
查看>>
CentOs7安装rabbitmq
查看>>
(转))iOS App上架AppStore 会遇到的坑
查看>>
解决vmware与主机无法连通的问题
查看>>
做好产品
查看>>
项目管理经验
查看>>