你的n不能超过20,超过就内存越界了,你说的随机数
用这个方法
int count=70; int N1=1,N2=1; int res=0; for(int i=3;i<=count;++i) { res = N1+N2; N1=N2; N2=res; } printf("%d\n",res);