#include <stdio.h>
int main()
{
int i,x1=1,x2=1,x3,sum;
printf ("x1= 1\nx2= 1\n");
for(i=3;i<=20;i++)
{
x3=x1+x2;
printf ("x%d= %4d\n",i,x3);
x1=x2;
x2=x3;
}
getchar();
return 0;
}
用win-tc运行的可以
int main()
{
int i,x1=1,x2=1,x3,sum;
printf ("x1= 1\nx2= 1\n");
for(i=3;i<=20;i++)
{
x3=x1+x2;
printf ("x%d= %4d\n",i,x3);
x1=x2;
x2=x3;
}
getchar();
return 0;
}
用win-tc运行的可以