Paste Search Dynamic
Recent pastes
money year rate
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main(){
  5.   double money, years, rate, sum; //宣告浮點型變數
  6.  
  7.   cin>>money>>years>>rate; //輸入本金, 年期, 利息
  8.   sum = money*pow((1+rate), years); //算出總額
  9.   cout<<sum<<endl;
  10.  
  11.   return 0;
  12. }
Parsed in 0.003 seconds