帮我写程序,求下面数列前20项之和:2/1,3/2,5/3,8/5,13/8,21/13.
问题描述:
帮我写程序,求下面数列前20项之和:2/1,3/2,5/3,8/5,13/8,21/13.
答
#include using namespace std;int sum(){ double i = 1, j = 2; double s, m, dTemp = j/i, dSum = dTemp; for (int k = 1; k