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
          主站蜘蛛池模板: 昆明市| 宣威市| 丰原市| 天峨县| 菏泽市| 沽源县| 诸城市| 永修县| 中西区| 治县。| 淄博市| 海口市| 襄城县| 洞口县| 青冈县| 收藏| 亚东县| 寿光市| 五家渠市| 郁南县| 乐清市| 冕宁县| 辽源市| 云龙县| 辽阳县| 郁南县| 仲巴县| 海原县| 太康县| 监利县| 伊吾县| 天津市| 黄骅市| 嘉荫县| 新田县| 双鸭山市| 汝州市| 黎川县| 靖安县| 勃利县| 体育|