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. linux shell命令的常用快捷键

    一些shell的常用快捷键.   Ctrl + a 切换到命令行开始  Ctrl + e 切换到命令行末尾  Ctrl + l 清除屏幕内容  Ctrl + u 清除剪切光标之前的内容  Ctrl + ...

  2. IOC----LightInject

    开源项目 引入 LightInject.cs 默认服务 new ServiceContainer 注册跟获取获取服务 container.Register<IFoo, Foo>();con ...

  3. VC++添加工具栏

    VC添加工具栏 方法一:添加ICON图标 1. 新建一个基于对话框的项目:Test 2. 在类CTestDlg中, 添加两个变量: CToolBarCtrl m_ToolBar1; CImageLis ...

  4. python 列表推导的注意点

    Code a = [1,2,2,3] b = [for item in a if item not in b] c = [] for item in a: if item not in c: c.ap ...

  5. dota 路人水平鉴定器

    测试的dota水平...目的是学习一下tornado框架 #coding:utf8 import tornado.web,tornado.httpserver,tornado.ioloop,torna ...

  6. stream的Read、Write方法实例

    , bytes.Length)) > ) , readBytes-);//8为偏移量,10为数量                    }                }            ...

  7. 2014年度辛星css教程夏季版第一节

    CSS是Cascading Style Sheets的缩写,即层叠样式表,它用于表现HTML的样式,即HTML只是去写该网页有哪些内容,至于如何去表现它们,由CSS去定制. ************* ...

  8. jcom2在win7 X86上操作Excel

    浅谈Java中利用JCOM实现仿Excel编程   在JAVA中使用JCOM和JXL注意要点: (1)在你的lib下要有jdom-1.0.jar,jxl-2.5.5.jar,jcom-2.2.4.ja ...

  9. 一步步学习ASP.NET MVC3 (2)——入门程序

    请注明转载地址:http://www.cnblogs.com/arhat 在上一节中,我们只是简单的介绍了什么是MVC及MVC的运行原理.而本节呢,主要来实现下一ASP.NET MVC3的开发流程,并 ...

  10. Apple 如何知道你使用了私有API

    大约有三种方式 otool -L这个工具可以清晰的列出你链接所有的库 像IO.Kit是不允许使用的 nm -u 这个工具可以清晰的列出你所有链接符号如 C方法 OC方法 检查所有Selecter的字符 ...