From fdcb7d0565c7527bd37f17605a4a69f443292ab2 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 17 Sep 2016 22:06:30 +0800 Subject: [PATCH] Create 5879_PrintTable.java --- HDOJ/5879_PrintTable.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 HDOJ/5879_PrintTable.java diff --git a/HDOJ/5879_PrintTable.java b/HDOJ/5879_PrintTable.java new file mode 100644 index 0000000..6c5a285 --- /dev/null +++ b/HDOJ/5879_PrintTable.java @@ -0,0 +1,20 @@ +import java.util.*; +import java.math.*; +public class Main +{ +public static void main(String[] args) +{ +BigDecimal bg=new BigDecimal("1"); +BigDecimal k=new BigDecimal("1"); +BigInteger ss=new BigInteger("1"); +BigInteger ddd=new BigInteger("1000000"); +for(BigInteger i=new BigInteger("2");!i.equals(ddd);i=i.add(ss)) +{ +bg=bg.add(k.divide(new BigDecimal(i.multiply(i)),100,BigDecimal.ROUND_HALF_UP)); +System.out.print(i); +System.out.print(" "); +System.out.print(bg); +System.out.println(); +} +} +}