UVA - 10494 If We Were a Child Again

用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的更多相关文章
- 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 ...
- (高精度运算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 ...
- UVA 10494 (13.08.02)
点此连接到UVA10494 思路: 采取一种, 边取余边取整的方法, 让这题变的简单许多~ AC代码: #include<stdio.h> #include<string.h> ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- Volume 1. Big Number(uva)
如用到bign类参见大整数加减乘除模板 424 - Integer Inquiry #include <iostream> #include <string> #include ...
- 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第五章 2(Big Number)
这里的高精度都是要去掉前导0的, 第一题:424 - Integer Inquiry UVA:http://uva.onlinejudge.org/index.php?option=com_onlin ...
- ACM java写法入门
打2017icpc沈阳站的时候遇到了大数的运算,发现java与c++比起来真的很赖皮,竟然还有大数运算的函数,为了以后打比赛更快的写出大数的算法并且保证不错,特意在此写一篇博客, 记录java的大数运 ...
- 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 ...
- UVA 10494-If We Were a Child Again(一流的塔尔苏斯)
Problem C If We Were a Child Again Input: standard input Output: standard output seconds "Oo ...
随机推荐
- saltstack基础篇
使用saltstack的前提是PPT 服务.流程.工具和技术 安装 rpm -Uvh http://mirrors.yun-idc.com/epel/6Server/x86_64/epel- ...
- 'phantomjs.exe' executable needs to be in PATH. (selenium PhantomJS python)
今天selenium PhantomJS python用了下,发现报错,提示我:'phantomjs.exe' executable needs to be in PATH. from seleniu ...
- HDU 3579——Hello Kiki
好久没写什么数论,同余之类的东西了. 昨天第一次用了剩余定理解题,今天上百度搜了一下hdu中国剩余定理.于是就发现了这个题目. 题目的意思很简单.就是告诉你n个m[i],和n个a[i].表示一个数对m ...
- innerHTML与innerText的区别: 前者获取的是dom对象内的所有html元素 后者获取的是dom对象里面的纯文本元素
- Android四大组件之Service(续)
本地服务启动和通过广播的方式回调是非常简单的. 下面介绍远程服务和通过远程回调的方式通知activity的方式. 1.service定义: package com.joyfulmath.globals ...
- 题解 P1334 【瑞瑞的木板】
声明:本题解已经与其他题解重合, ### 且存在压行情况. 首先,这个题解是我有了惨痛的教训:全部WA... 先发一个CODE做声明: #include <bits/stdc++.h> / ...
- lxm --- ans lb config
lxm --- ans lb config #ANS2.2 Build 160.006 # Last modified by `save config`, Fri Oct 12 17:15:42 20 ...
- Debugging QML Applications
Debugging QML Applications Console API Log console.log, console.debug, console.info, console.warn an ...
- 【比赛】HNOI2018 转盘
通过这题,我发现了我最大的缺陷,就是题目中重要的性质发现不了,所以导致后期根本做不了.还是要多做题,培养思维 对于这道题,来发现性质吧 对于每一条路线,因为它有用的就是最终的时刻,所以我们都可以把它变 ...
- 【BZOJ5248】【九省联考2018】一双木棋(搜索,哈希)
[BZOJ5248][九省联考2018]一双木棋(搜索,哈希) 题面 BZOJ Description 菲菲和牛牛在一块n行m列的棋盘上下棋,菲菲执黑棋先手,牛牛执白棋后手.棋局开始时,棋盘上没有任何 ...