看下面代码:int a = 13; double rt = 0.07; int year = 0; double sum = a*(1+rt); year++; while(sum <= 15){ sum = sum*(1+rt); year++; } System.out.println("需要"+year+"年");