UVA - 10494 If We Were a Child Again

Posted daybreaking

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了UVA - 10494 If We Were a Child Again相关的知识,希望对你有一定的参考价值。

技术分享图片

 

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

技术分享图片
 1 import java.util.*;
 2 import java.math.*;
 3 public class Main {
 4         public static void main(String args[]) {
 5             Scanner cin = new Scanner(System.in);
 6             
 7             BigInteger a,b,ans;
 8             String c;
 9             b = BigInteger.valueOf(1);
10             a = BigInteger.valueOf(1);
11         //    BigInteger zero=new BigInteger("0");
12             
13             while(cin.hasNext())
14             {
15                 a=cin.nextBigInteger();
16                 c=cin.next();
17                 b=cin.nextBigInteger();
18                 if(c.equals("/"))
19                     ans = a.divide(b);
20                 else
21                     ans=a.mod(b);
22                 System.out.println(ans);
23             }
24             return ;
25     }
26     
27 }
View Code

 

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

以上是关于UVA - 10494 If We Were a Child Again的主要内容,如果未能解决你的问题,请参考以下文章

《We Were Here》Steam限时免费游玩 双人合作游戏

V3 - If I were You Teacher: Russell

求if 引导的从句 练习题

Would Your Work Habits Change if You Were Paid by the Job?

If only it could be all the same like we first me

UVA 10689 Yet another Number Sequence