?? pku1405.java
字號(hào):
import java.io.*;
import java.util.*;
import java.math.BigInteger;
class Main
{
public static void main(String args[]) throws Exception
{
Scanner cin=new Scanner(System.in);
int i, n;
BigInteger up, down, j;
while(cin.hasNext())
{
up = BigInteger.ONE;
down = BigInteger.ONE;
n = cin.nextInt();
for (i = 0; i < n; i++)
{
if (down.mod(up).equals(BigInteger.ZERO))
{
j = down.add(BigInteger.ONE).divide(up);
}
else
{
j = down.divide(up);
}
up = up.multiply(j);
up = up.add(down.negate());
down = down.multiply(j);
System.out.println(j);
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -