Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请问一下,这道题怎么解啊?不会用二项展开式吧或高精度吧?

Posted by yinsheng at 2005-04-02 23:10:39 on Problem 2390
#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char *argv[])
{
  float r,m,y;
  int i;
  float money; 
  float rate;
  while (cin>>r>>m>>y) {
    money = m;
    rate = r/100;
    rate = 1+rate;
    for(i=1;i<=y;i++) {
      money = money*rate;
    }    
    printf("%.0f\n",money-0.5);
  }    
  //system("PAUSE");	
  return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator