Fw: [C++ ]考古題解答 費朋納西序列

看板NTUBIME104HW作者 (豆腐)時間14年前 (2011/12/10 01:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
※ [本文轉錄自 NTUBIME103HW 看板 #1CsKqMRa ] 作者: steve1012 (steve) 看板: NTUBIME103HW 標題: [C++ ]考古題解答 費朋納西序列 時間: Tue Nov 9 21:31:00 2010 這是費氏數列解答 #include "stdafx.h" #include "iostream" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int arr[20]={0}; arr[0]=1; arr[1]=1; cout<<arr[0]<<"\t"; cout<<arr[1]<<"\t"; for(int i=2;i<=19;i++) { arr[i]=arr[i-1]+arr[i-2]; cout<<arr[i]<<"\t"; if(i%5==4) cout<<endl; } system("pause"); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.161.76.90 ※ 編輯: steve1012 來自: 118.161.76.90 (11/09 21:31)

11/15 09:51, , 1F
維峻大神
11/15 09:51, 1F
※ 發信站: 批踢踢實業坊(ptt.cc) ※ 轉錄者: g85101878 (140.112.218.137), 時間: 12/10/2011 01:07:26
文章代碼(AID): #1Eua1FkR (NTUBIME104HW)