poj2305 Basic remains
2016-02-28 16:56
399 查看
高精度整数转进制取模。
Biginteger a=cin.nextBigteger(b); //高精度整数a以b进制读入。
a.toString(b)//a以b进制字符串形式输出
Biginteger a=cin.nextBigteger(b); //高精度整数a以b进制读入。
a.toString(b)//a以b进制字符串形式输出
import java.io.*; import java.math.*; import java.util.Scanner; public class poj_2305 { public static void main(String[] args){ Scanner cin=new Scanner(System.in); while(true){ int a; BigInteger b,c,ans; a=cin.nextInt(); if(a==0) break; b=cin.nextBigInteger(a); c=cin.nextBigInteger(a); ans=b.mod(c); System.out.println(ans.toString(a)); } } }
相关文章推荐
- MHA自动Failover过程解析(updated)
- 实现raidogroup与fragment+viewpager的交互
- keil Error: failed to execute 'C:\Keil\ARM\ARMCC'的解决方法
- keil5 编译程序出现错误Error: L6411E: No compatible library exists with a definition of startup symbol __main
- ZOJ-3780-Paint the Grid Again【11th浙江省赛】
- Leetcode ☞ 319. Bulb Switcher ☆ brain teaser
- PAT (Top Level) Practise 1008 Airline Routes (35)
- LightOJ 1236 Pairs Forming LCM (唯一分解定理)
- 内核线程与用户线程的区别 http://blog.csdn.net/wangkechuang/article/details/7883170
- 1106 Lowest Price in Supply Chain
- AIDL 一
- lintcdoe: Number of Airplanes in the Sky
- Leetcode ☞ 217. Contains Duplicate
- 【UVa】11413 – Fill the Containers
- GCJ--Millionaire (2008 APAC local onsites C)
- 关于main主函数的两个参数argc和argv
- ZOJ 3781 Paint the Grid Reloaded 图论 bfs
- 11.2 RAC: In "crsctl stat res -t" State Details May Be Missing or Incorrect (文档 ID 1086563.1)
- Hanoi Tower Troubles Again! (找规律)
- GetPostBackEventReference加RaisePostBackEvent实现自定义控件中回调传参