zoukankan      html  css  js  c++  java
  • UVA

    用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

  • 相关阅读:
    多进程2
    并发编程
    粘包
    socket
    网络编程
    异常与网络编程
    面向对象高级
    多态
    面向对象2
    SQL数据库约束行为---防止数据乱填(即数据规范化)
  • 原文地址:https://www.cnblogs.com/daybreaking/p/9381362.html
Copyright © 2011-2022 走看看