mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 5879_PrintTable.java
This commit is contained in:
parent
4f69664afa
commit
fdcb7d0565
20
HDOJ/5879_PrintTable.java
Normal file
20
HDOJ/5879_PrintTable.java
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user