菜鸟的处女作

fish_up 2015-03-21 04:33:13
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());
}
}
...全文
149 回复 打赏 收藏 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,620

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧