/**
* 逐渐趋近100的算法
*/
public class Test1 {
public static void main(String[] args) {
// TODO 自动生成方法存根
//算法一
/*int r=0;
while(true){
r+=(((100-r)/2)+1);
if(r != 104)
System.out.println(r);
}*/
//算法二
float b = 0;
float temp;
while(true){
float result = 100;
//temp = (float) ((result - (b))*0.2);
//result = result - temp;
result = (float) (result - ((result - b)*0.2));
b = result;
//if((int)result != 100)
System.out.println(result);
}
}
}