C primer plus 练习题 第六章

16.

 1 #include <stdio.h>
 2 
 3 int main()
 4 {
 5     double remain = 100.0;
 6     int years=0;
 7     while(remain>0)
 8     {
 9         remain = remain * 0.08 + remain - 10.0;
10         printf("%f \t", remain);
11         printf("years:%d \n", years);
12         years++;
13     }
14     printf("一共可以取:%d 年", years);
15     
16     getchar();
17     return 0;
18 }

 

posted @ 2014-07-06 12:48  践道者  阅读(369)  评论(0编辑  收藏  举报