#include <stdio.h>
int Square (int i);
int main()
{
int i = 0;
i = Square (i);
for (; i< 3; i++)
{
static int i= 1;
i += Square(i);
printf("%d", i);
}
printf("%d\n", i);
return 0;
}
int Square (int i)
{
return i*i;
}
static int i = 1;
i += Square(i);
printf("%d ", i);
这三行的i不是for循环的i,是局部静态变量i,所以for循环的i还是1,2,3