double temp = 0;
for(int i=1;;i++)
{
if(i % 2 == 1)
temp = temp + (1 / ((double)i + 1));
else
temp = temp - (1 / ((double)i + 1));
if (temp < 0.1)
break;
System.out.println(temp);
}
}
for(int i=1;;i++)
{
if(i % 2 == 1)
temp = temp + (1 / ((double)i + 1));
else
temp = temp - (1 / ((double)i + 1));
if (temp < 0.1)
break;
System.out.println(temp);
}
}
解决方案 »
- 我在修改某个存储过程时,系统提示该过程被锁定,请问有那些因素会导致过程被锁定,如何解除锁定?
- 服务器如何挂网站?
- Hibernate的分页技术
- 一个hibernate3乱码的问题
- 请问ejb-jar,weblogic-ejb-jar,weblogic-cmp-rdbms-jar.xml怎么写?
- MyEclipse10开发EJB
- 那位大哥手上有没有现成的web应用程序,越小越好,只要能运行就可以,很急!马上就要用到!非常感谢!
- 初学者在TOMCAT中使用SSL
- struts关于页面检查的问题
- 那有rose载呀!!跑遍了DB市场都没有!!!
- 有关登陆验证问题
- spring+hibernate1对1关联中ClassCastException
s = (1-1/2) + (1/3-1/4) + (1/5-1/6) +...
s = 1/2 + 1/12 + 1/30 + ...
这个极限怎么求忘了,但是我不知道s>0.1什么意思?