第二十五次发博不知道用什么标题好
package Test; public class Willbemore { public static void main(String[] args) { // TODO Auto-generated method stub double timeAddALittle = 1.01; double timeMinusALittle = 0.99; double total = 1; for (int i = 0; i < 365; i++) { total = (timeAddALittle * total); } System.out.println("每天进步一点点,一年之后就是" + total); total = 1; for (int j = 0; j < 365; j++) { total = (timeMinusALittle *total); } System.out.println("每天退步一点点,一年之后就是" + total); } }
哈哈哈因为timeMinusALittle的初值赋成了0.09答案就一直是0.0,越看越不对,后来改成了0.99.....emmm就出来了,今天发了协会的工作牌诶好开心成为协会第一届成员呐