Oo緣來是你oO


          posts - 120,comments - 125,trackbacks - 0


          public class Fibonacci {

              
          private static int MAX = 100;
              
          /*
               * print the Fibonacci sequence for values < MAX
               
          */
              
          public static void main(String[] args) {
                  
          int currentVal    = 1;
                  
          int nextVal        = 1;
                  
          while(currentVal<MAX){
                      System.out.println(currentVal);
                      nextVal 
          = nextVal + currentVal ;
                      currentVal 
          = nextVal - currentVal;
                  }
              }
          }



          馬嘉楠
          jianan.ma@gmail.com

          posted on 2007-04-18 16:47 馬嘉楠 閱讀(456) 評論(0)  編輯  收藏 所屬分類: SoureCode
          主站蜘蛛池模板: 高要市| 汝州市| 体育| 靖江市| 汤原县| 南涧| 隆安县| 宣恩县| 元氏县| 龙泉市| 柳州市| 革吉县| 那曲县| 鹤岗市| 阳江市| 富阳市| 普陀区| 龙海市| 安远县| 繁昌县| 龙江县| 若羌县| 阳山县| 红河县| 大余县| 沙河市| 北辰区| 墨脱县| 福州市| 平谷区| 蕲春县| 太谷县| 泸州市| 芜湖市| 乡城县| 唐海县| 景德镇市| 弥渡县| 垣曲县| 曲阜市| 彭山县|