Results 1 to 8 of 8

Thread: เขียน php หาค่าเลขยกกำลังที่มีค่าเยอะๆ

  1. #1
    Senior Member retool2's Avatar
    Join Date
    Aug 2008
    Location
    Under Relocation
    Posts
    178


    คุณเคยสงสัยหรือไม่ว่าหลายๆครั้งการเขียนโปรแกรมเกี่ยวกับตัวเลขจะมี limit ของมัน
    เช่น
    [code]<?php
    for($i=5;$i<15;$i++){

  2. #2
    Member
    Join Date
    Jan 2007
    Location
    $home/bin
    Posts
    99


    Wink

    มาเพิ่มเติมข้อมูลหน่อยนะครับ


    **Hidden Content: To see this hidden content your post count must be 10 or greater.**


    Opensource : [url=http://www.mangluck.com]?mangluck[/url]

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Posts
    21


    ถ้าเป็นสคริปพวก แยกค่าตัวประกอบแบบนี้หล่ะครับ

    <?php
    $a = $_REQUEST[&#39;e&#39;];
    if ($a%2 == 0)
    {
    if ($a==2)
    {
    echo "2*1";
    }
    if ($a==4)
    {
    echo "2*2";
    }
    if ($a==6)
    {
    echo "2*3";
    }
    if ($a==8)
    {
    echo "2*2*2";
    }
    if ($a==10)
    {
    echo "2*5";
    }
    if ($a==12)
    {
    echo "2*2*3";
    }[/b]
    มันจะมีวิธีเขียนง่ายๆกว่านี้ไหมครับ แบบนี้มัน ยาวมากเลย ทำให้ช้าด้วยผมเพิ่งจะฝึกหัดหนะครับ หวังว่าจะได้รับคำชี้แนะนะครับ

  4. #4
    Junior Member
    Join Date
    Dec 2009
    Posts
    0


    ผมเคยเขียนแบบใช้ loop เอา
    แต่ไม่ทราบว่า มันจาได้เยอะขนาดนี้หรือเปล่า เดี๋ยวต้องลองเขียนใหม่ดู
    น่าสนุกดีครับ

  5. #5
    Junior Member
    Join Date
    Dec 2009
    Posts
    0


    ผมเคยเขียนแบบใช้ loop เอา
    แต่ไม่ทราบว่า มันจาได้เยอะขนาดนี้หรือเปล่า เดี๋ยวต้องลองเขียนใหม่ดู
    น่าสนุกดีครับ

Similar Threads

  1. Replies: 0
    Last Post: 30-01-2008, 10:51 AM
  2. Replies: 0
    Last Post: 10-01-2008, 08:23 PM
  3. Replies: 3
    Last Post: 14-05-2007, 10:27 PM
  4. เขียน graphics ไม่ได้
    By autthapon in forum C/C++,C#,VC++,MFC,Win32
    Replies: 4
    Last Post: 13-02-2004, 02:12 AM
  5. Replies: 0
    Last Post: 01-01-1970, 07:00 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •