#include <iostream>
using namespace std;
int main()
{
int a,b=1,c=0;
cout<<c<<" "<<b<<" ";
for(int i=3;i<=20;i++)
{
a=b+c;
c=b;
b=a;
cout<<a<<" ";
if(i%5==0)
cout<<endl;
}
system("pause");
return 0;
}
--------------------------------------------
Sorry~ 上次的程式碼 輸出的時候 第一排會有六個
因為一開始已經輸出兩個了 所以起始值因該是從3開始
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.4.234