#include<iostream>
using namespace std
int main()
{
unsigned long x,WarCraft,war,l
cin> x
while(x)
{
unsigned long *p=new unsigned long[x+1]
if(p==NULL)
{
cerr<<"error!"<<endl
abort()
}
for(WarCraft=0 WarCraft<=x WarCraft++)
*(p+WarCraft)=0
*p=1
for(WarCraft=0 WarCraft<x WarCraft++)
{
cout<<*p<<" "
war=*p
for(l=1 x>1 l++)
{
if(*(p+l)==0)
{
cout<<endl
*(p+l)=1
break
}
else
{
cout<<*(p+l)<<" "
*(p+l)=war+*(p+l)
war=*(p+l)-war
}
}
}
cout<<endl
delete [] p
cin>>x
}
return 0
}
标签:
namespace
iostream
unsigned
WarCraft
上传时间:
2015-12-12
上传用户:manlian