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

 import java.util.*;
import java.math.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in); BigInteger a,b,ans;
String c;
b = BigInteger.valueOf();
a = BigInteger.valueOf();
// BigInteger zero=new BigInteger("0"); while(cin.hasNext())
{
a=cin.nextBigInteger();
c=cin.next();
b=cin.nextBigInteger();
if(c.equals("/"))
ans = a.divide(b);
else
ans=a.mod(b);
System.out.println(ans);
}
return ;
} }

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

UVA - 10494 If We Were a Child Again的更多相关文章

  1. uva 10494 - If We Were a Child Again 大数除法和取余

    uva 10494 - If We Were a Child Again If We Were a Child Again Input: standard inputOutput: standard ...

  2. (高精度运算4.7.27)UVA 10494 If We Were a Child Again(大数除法&&大数取余)

    package com.njupt.acm; import java.math.BigInteger; import java.util.Scanner; public class UVA_10494 ...

  3. UVA 10494 (13.08.02)

    点此连接到UVA10494 思路: 采取一种, 边取余边取整的方法, 让这题变的简单许多~ AC代码: #include<stdio.h> #include<string.h> ...

  4. UVA题目分类

    题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...

  5. Volume 1. Big Number(uva)

    如用到bign类参见大整数加减乘除模板 424 - Integer Inquiry #include <iostream> #include <string> #include ...

  6. 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第五章 2(Big Number)

    这里的高精度都是要去掉前导0的, 第一题:424 - Integer Inquiry UVA:http://uva.onlinejudge.org/index.php?option=com_onlin ...

  7. ACM java写法入门

    打2017icpc沈阳站的时候遇到了大数的运算,发现java与c++比起来真的很赖皮,竟然还有大数运算的函数,为了以后打比赛更快的写出大数的算法并且保证不错,特意在此写一篇博客, 记录java的大数运 ...

  8. UVA大模拟代码(白书训练计划1)UVA 401,10010,10361,537,409,10878,10815,644,10115,424,10106,465,10494

    白书一:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=64609#overview 注意UVA没有PE之类的,如果PE了显示WA. UVA ...

  9. UVA 10494-If We Were a Child Again(一流的塔尔苏斯)

    Problem C If We Were a Child Again Input: standard input Output: standard output  seconds   "Oo ...

随机推荐

  1. HDU 2156 分数矩阵

    http://acm.hdu.edu.cn/showproblem.php?pid=2156 Problem Description 我们定义如下矩阵:1/1 1/2 1/31/2 1/1 1/21/ ...

  2. PHP之array_flip()方法

    array_flip — 交换数组中的键和值 array array_flip ( array $trans ) array_flip() 返回一个反转后的 array,例如 trans 中的键名变成 ...

  3. Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction

    我在update数据库的时候出现的死锁 数据库表死锁 Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackExcept ...

  4. 使用 Maven 管理项目

    最近的练手项目使用的是 Maven 在管理项目,在使用 Maven 管理项目时,三层的开发时分模块开发的,parent-dao-service-web,所有的spring+struts + Hiber ...

  5. 第94天:CSS3 盒模型详解

    CSS3盒模型详解 盒模型设定为border-box时 width = border + padding + content 盒模型设定为content-box时 width = content所谓定 ...

  6. 第80天:jQuery插件使用

    jQuery其他补充+ 4.1 链式编程: end()补充 * 补充五角星 评论案例 * 第一步:鼠标移入,当前五角星和前面的五角星变实体.后面的变空心五角星 * 第二步:鼠标点击的时候,为当前元素添 ...

  7. BZOJ3712 PA2014Fiolki(kruskal重构树)

    对合并过程建树.然后只需要按照时间顺序考虑每个反应就行了,时间顺序根据lca的深度确定. #include<iostream> #include<cstdio> #includ ...

  8. [NOIP2008]双栈排序 【二分图 + 模拟】

    题目描述 Tom最近在研究一个有趣的排序问题.如图所示,通过2个栈S1和S2,Tom希望借助以下4种操作实现将输入序列升序排序. 操作a 如果输入序列不为空,将第一个元素压入栈S1 操作b 如果栈S1 ...

  9. 常用Actoin算子 与 内存管理 、共享变量、内存机制

    一.常用Actoin算子 (reduce .collect .count .take .saveAsTextFile . countByKey .foreach ) collect:从集群中将所有的计 ...

  10. jquery、css3动态显示百分比圆

    动态显示百分圆 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <m ...