fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4.  
  5. {
  6.  
  7. double j=10000;
  8.  
  9. double a,b,c,d,e;
  10.  
  11. a=j*(1+0.0375*5);
  12.  
  13. b=j*(1+0.03*2);
  14.  
  15. b=b*(1+0.035*3);
  16.  
  17. c=j*(1+0.035*3);
  18.  
  19. c=c*(1+0.03*2);
  20.  
  21. d=j;
  22.  
  23. for (int i = 0; i < 5; i++) {
  24.  
  25. d = d* (1 + 0.025);
  26.  
  27. }
  28.  
  29. e = j;
  30.  
  31. for (int i = 0; i < 5 * 4; i++) {
  32.  
  33. e = e * (1 + 0.0035 / 4);
  34.  
  35. }
  36.  
  37. printf("五种存款方案结果:\n");
  38.  
  39. printf("方案一:%.2f元\n",a);
  40.  
  41. printf("方案二:%.2f元\n",b);
  42.  
  43. printf("方案三:%.2f元\n",c);
  44.  
  45. printf("方案四:%.2f元\n",d);
  46.  
  47. printf("方案五:%.2f元\n",e);
  48.  
  49. return 0;
  50.  
  51. }
  52.  
  53.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
五种存款方案结果:
方案一:11875.00元
方案二:11713.00元
方案三:11713.00元
方案四:11314.08元
方案五:10176.46元