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 馬嘉楠 閱讀(452) 評論(0)  編輯  收藏 所屬分類: SoureCode
          主站蜘蛛池模板: 孝昌县| 平邑县| 大庆市| 临安市| 鸡泽县| 桦南县| 诸暨市| 芒康县| 姚安县| 临夏市| 安宁市| 原阳县| 罗源县| 玉山县| 永善县| 贵溪市| 双城市| 抚松县| 漯河市| 波密县| 游戏| 沂源县| 浦北县| 宝清县| 湖北省| 徐水县| 政和县| 资溪县| 谷城县| 巩义市| 溆浦县| 光山县| 龙州县| 竹山县| 松溪县| 清河县| 武隆县| 宁波市| 嘉义市| 禹城市| 赞皇县|