⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.cpp

📁 BigC++的源码
💻 CPP
字号:
#include <iostream>
#include <cmath>

using namespace std;

double balance;

/** 
   Accumulates interest in the global variable balance
   @param p the interest rate in percent
   @param n the number of periods the investment is held
*/
void future_value(double p, int n)
{  
   balance = balance * pow(1 + p / 100, n); 
}

int main()
{  
   balance = 10000;
   future_value(5, 10);
   cout << "After ten years, the balance is "
      << balance << "\n";
   return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -