第五題

看板NTUBIME96-HW作者 (無姦道之魚紋肥..)時間22年前 (2003/12/08 23:37), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
#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
文章代碼(AID): #_r9gY6s (NTUBIME96-HW)