精華區beta NTUBIME96-HW 關於我們 聯絡資訊
#include "stdafx.h" #include "iostream" using std::cout; using std::endl; #include "cmath" double x(int); int main() { for (int i=1;i<=10;i++) { float n=1; for (int j=1;j<=20;j++) { n=n+pow(i,j)/x(j); } cout<<"e^"<<i<<"="<<n<<endl; } return 0; } double x(int a) { double c=1; for (int b=1;b<=a;b++) c=c*b; return c; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.66.224.99