本帖最后由 qzxm9yzcc 于 2011-03-28 20:36:36 编辑

解决方案 »

  1.   

    改了下,诶呀,浮躁哦!
    public static List<Integer> testMethod(int count) {
    List<Integer> list = new ArrayList<Integer>();
    for (int i = 1, j = 1; i <= count; i += j, j += i) {
    list.add(i);
    list.add(j);
    }
    list.remove(list.size() - 1);
    return list;
    }
      

  2.   

    个人觉得,根据这个定义
    In mathematics, computer science, and related subjects, an algorithm is an effective method for solving a problem using a finite sequence of instructions. Algorithms are used for calculation, data processing, and many other fields.
    你这个算是一个算法。
    你解决的问题是打印Fibonacci数列,并在有限的代码行数中解决。所以是一个算法。
      

  3.   

    写得很不错,但是为了减少代码的行数,而把诸多的运算写到 for 当中去了。代码是给人看的,不是给计算机“看”的,无论怎么样的算法写出得通俗易懂,而不是要看个半天才能看明白这是在干嘛。你甚至可以写成这样!但这样又能说明什么呢?public static void testMethod(int count) {
        for (int i = 1, j = 1; j <= count; System.out.printf(i + " " + j + " "), j += i += j);
    }
      

  4.   

    我写的那个算法也跟楼主第一个差不多,但我的是正确的。刚开始学,不知道递归的格式,写了一个递归的,有错误。就改成楼主的第一个了。14楼说的好。楼主的第二个程序中,list是啥东西