如何把斐波那契數列前100項輸出到文?
#include
#include
using namespace std;
int main(int argc,char *argv[])
{
char out[]="fibo.txt";
int i,n,*fibo;
ofstream outf(out,ios_base::out);
printf("請輸入要輸出到文件的斐波那契數列的項數:");
scanf("%d",&n);
fibo=(int*)calloc(n,sizeof(int));
fibo[0]=0;
fibo[1]=1;
for(i=2;i