java有大数模板

import java.util.Scanner;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner cin =new Scanner(System.in);
int T=cin.nextInt();
BigInteger c=BigInteger.valueOf(0);
for(int i=1;i<=T;++i){
BigInteger a=cin.nextBigInteger();
BigInteger b=cin.nextBigInteger();
b=b.abs();
a=a.mod(b);
System.out.print("Case "+i+": ");
if(a.compareTo(c)==0)System.out.println("divisible");
else System.out.println("not divisible");
}
}
}

LightOJ 1214 Large Division 水题的更多相关文章

  1. LightOJ 1214 Large Division

    Large Division Given two integers, a and b, you should check whether a is divisible by b or not. We ...

  2. light oj 1214 - Large Division

    1214 - Large Division   PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB G ...

  3. light oj 1214 - Large Division 大数除法

    1214 - Large Division Given two integers, a and b, you should check whether a is divisible by b or n ...

  4. 1214 - Large Division -- LightOj(大数取余)

    http://lightoj.com/volume_showproblem.php?problem=1214 这就是一道简单的大数取余. 还想还用到了同余定理: 所谓的同余,顾名思义,就是许多的数被一 ...

  5. LightOJ 1248 Dice (III) (水题,期望DP)

    题意:给出一个n面的色子,问看到每个面的投掷次数期望是多少. 析:这个题很水啊,就是他解释样例解释的太...我鄙视他,,,,, dp[i] 表示 已经看到 i 面的期望是多少,然后两种选择一种是看到新 ...

  6. lightoj 1020 (博弈水题)

    lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个 ...

  7. LightOJ 1023 Discovering Permutations 水题

    http://www.lightoj.com/volume_showproblem.php?problem=1023 题意:26字母全排列 思路:用next_permutation或者思维想一下都可以 ...

  8. codeforces 558B B. Amr and The Large Array(水题)

    题目链接: B. Amr and The Large Array time limit per test 1 second memory limit per test 256 megabytes in ...

  9. 二分--LIGHTOJ 1088查找区间(水题)

    #include <iostream> #include <cstdio> #include <cmath> using namespace std; const ...

随机推荐

  1. Python3 错误处理 和 测试

    try 让我们用一个例子来看看try的机制: try: print('try...') r = 10 / 0 except ZeroDivisionError as e: print('except: ...

  2. LPC17XX 数据手册摘要之系统时钟与功率控制

    系统时钟与功率控制 一.系统时钟 LPC17XX有三个独立的时钟振荡器,分别是主振荡器(MIAN_OSC).内部RC振荡器(IRC_OSC).实时时钟振荡器(RTC_OSC).LPC17XX时钟框图如 ...

  3. winfrom 多语言切换

    1.首先将窗体的“Localizable”属性置为“True”,然后将“Language”属性置为自己想要的语言,点击重新生成项目 例如:置为“中文”,以及“英文”.当每次置为不同的语言并重新生成项目 ...

  4. mysqldump备份与还原mysql数据的实例

    有关mysql数据库的备份与还原,我们一般用下面两种方式来处理:1.使用into outfile 和 load data infile导入导出备份数据 本文原始链接:http://www.jbxue. ...

  5. C语言基础知识-循环结构

    用while打印出1~100之间7的倍数    int i = 1;     while循环是当条件表达式的结果为真时,执行大括号里面的循环体,重复执行直到条件表达式的结果为假时结束循环.     w ...

  6. C# dynamic

    [TestMethod] public void DynamicTest() { dynamic Customer = new ExpandoObject(); Customer.Name = &qu ...

  7. UICountingLabel实现数字变化的动画效果-b

    在大多数金融类 app 上或者其他 app 需要数字展示的地方, 经常会有如下的动画效果: 动画效果 怎么做呢? 一.下载UICountingLabel 下载地址: https://github.co ...

  8. 贝塞尔曲线算法,js贝塞尔曲线路径点

    //anchorpoints:贝塞尔基点 //pointsAmount:生成的点数 //return 路径点的Array function CreateBezierPoints(anchorpoint ...

  9. selenium各种场景下的启动Firefox

    开始学习selenium时为了启动Firefox可谓费尽周折,在大神的帮助下才堪堪搞定,走出了selenium的第一步:jdk1.8 + selenium_2.46 + Firefox国际版40.0. ...

  10. Hadoop集群(第10期)_MySQL关系数据库

    1.MySQL安装 MySQL下载地址:http://www.mysql.com/downloads/ 1.1 Windows平台 1)准备软件 MySQL版本:mysql-5.5.21-win32. ...