HDOJ 1568 Fibonacci 解题报告(2)
日期:2011-08-07
点击:23
来源: 未知
分享至:
\";
}
if (n == 1) {
return \"1\";
}
BigInteger a = new BigInteger(\"0\");
BigInteger b = new BigInteger(\"1\");
BigInteger c = null;
for (int i = 2; i <= n; ++i) {
c = a.add(b);
a = b;
b = c;
}
s = c.toString();
if (s.length() > 4) {
s = s.substring(0, 4);
}
return s;
}
}
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史