fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int year=0;
  5. double money=10000,riritu=1.01;
  6. while(money<=15000){
  7. money=money*riritu;
  8. year++;
  9. }
  10. printf("%d\n%f",year,money);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
41
15037.523709