// 迭代法求fibonacci数列
public class p52 {
public static void main(String[] args)
{
int f1=1,f2=1;
for(int i=1;i<=18;i++)
{
System.out.print(f1+" "+f2+" ");
if(i%3==0)
System.out.println();
f1=f1+f2; //迭代法求fibonacci数列
f2=f2+f1;
}
}
}
// 迭代法求fibonacci数列
public class p52 {
public static void main(String[] args)
{
int f1=1,f2=1;
for(int i=1;i<=18;i++)
{
System.out.print(f1+" "+f2+" ");
if(i%3==0)
System.out.println();
f1=f1+f2; //迭代法求fibonacci数列
f2=f2+f1;
}
}
}