poj 2390 Bank Interest

#include<iostream>
using namespace std;

int main()
{
    double r, m, y, ans; 
    int i; 
    cin >> r >> m >> y;
    ans = 0; 
    r = r * 1.0 / 100 + 1; 
    for (i = 0; i < y; i++){
        ans = m * r;
        m = ans; 
    } 
    cout << (int)ans << endl;
    system("pause"); 
} 

你可能感兴趣的:(System)