Lab 12-12-2005 (2) Static Class
public class Lab12122
{
public static double i=1,j=1,k=0;
public static double next()
{
k=i+j;
i=j;
j=k;
return k;
}
public static void main(String[] args)
{
int m;
for(m=0;m<=100;m++)
{
Lab12122.next();
System.out.println("F"+m+":"+k);
}
}
}
{
public static double i=1,j=1,k=0;
public static double next()
{
k=i+j;
i=j;
j=k;
return k;
}
public static void main(String[] args)
{
int m;
for(m=0;m<=100;m++)
{
Lab12122.next();
System.out.println("F"+m+":"+k);
}
}
}
0 Comments:
張貼留言
<< Home