菜鸟的处女作
public class 序列求和 {
// private static final BigDecimal ONE = null;
public static BigInteger he(BigInteger n){
if (n.compareTo(BigInteger.ONE)>=0) {
return BigInteger.ONE;
}
return n.add(n.subtract(BigInteger.ONE));
}
public static void main(String args[]){
System.out.print("n=");
String n=(new Scanner(System.in)).nextLine();
BigInteger bd=new BigInteger(n);
System.out.println("输出和:");
System.out.println(he(bd).toString());
}
}