/**
 * Prints the first n Fibonacci numbers, where n is provided as a command 
 * line argument.  If n is smaller than 1, the first Fibonacci number is
 * printed.
 *
 * @version     1.2    September 2, 1999
 * @author      Franck van Breugel
 */
public class ParameterizedFibonacci 
{
    /**
     * Prints the first n Fibonacci numbers, where n is provided as a 
     * command line argument. 
     */
    public static void main(String[] args) 
    {
        int lo = 1; // f(0)
        int hi = 1; // f(1)
        int n = Integer.parseInt(args[0]); // first command line argument
        System.out.println(lo);
        for (int i = 1; i < n; i++) 
        { 
            /* lo = f(i-1) and hi = f(i) */
            System.out.println(hi);
            int temp = hi;
            hi = lo + hi;
            lo = temp; 
        }
    }
}
