線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1568
推到 Plurk!
推到 Facebook!

Perfect Cubes

尚未結案
writeman
初階會員


發表:31
回覆:34
積分:28
註冊:2004-02-17

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-12-24 15:24:27 IP:61.70.xxx.xxx 未訂閱
For hundreds of years Fermat's Last Theorem, which stated simply that for n > 2 there exist no integers a, b, c > 1 such that a^n = b^n c^n, has remained elusively unproven. (A recent proof is believed to be correct, though it is still undergoing scrutiny.) It is possible, however, to find integers greater than 1 that satisfy the ``perfect cube'' equation a^3=b^3 c^3 d^3 (e.g. a quick calculation will show that the equation 12^3 = 6^3 8^3 10^3is indeed true). This problem requires that you write a program to find all sets of numbers {a, b, c, d} which satisfy this equation for . The first part of the output is shown here: Cube = 6, Triple = (3,4,5) Cube = 12, Triple = (6,8,10) Cube = 18, Triple = (2,12,16) Cube = 18, Triple = (9,12,15) Cube = 19, Triple = (3,10,18) Cube = 20, Triple = (7,14,17) Cube = 24, Triple = (12,16,20)
無故障
一般會員


發表:17
回覆:69
積分:17
註冊:2004-03-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-06 18:42:50 IP:61.221.xxx.xxx 未訂閱
這是歷史上很有名證明題嗎? 不是很難解嗎? 用到最後只能用理論方式證明.... 練習! 練習! 再練習!
------
嘿嘿嘿
無故障
一般會員


發表:17
回覆:69
積分:17
註冊:2004-03-11

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-01-07 09:56:52 IP:61.221.xxx.xxx 未訂閱
供參考 這個好像是作業....    
    //---------------------------------------------------------------------------
#include 
#pragma hdrstop    #include "Unit1.h"
#include "math.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"    long Sum[1000];
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    for (int i=0;i< 1000 ; i  )
    {
        Sum[i] = pow( (i 1) , 3 ) ;
    };
}
//---------------------------------------------------------------------------    void __fastcall TForm1::Button1Click(TObject *Sender)
{
    long KeyIn; //輸入數字
    KeyIn = Edit1->Text.ToInt()-1 ;        RichEdit1->Text ="" ;        for (int A = (KeyIn-1); A >2; A--)
    {
        if ( Sum[KeyIn] > ( Sum[A]   Sum[A-1]  Sum[A-2] ) )
        {
            break;
        } ;            for (int B = (A-1) ; B >1;B--)
        {
            if ( Sum[KeyIn] > ( Sum[A]   Sum[B]  Sum[B-1] ) )
            {
                break;
            }                for (int C = (B-1) ; C >0;C--)
            {
                if ( Sum[KeyIn] == ( Sum[A]   Sum[B]  Sum[C] ) )
                {   //OK
                    RichEdit1->Text =  RichEdit1->Text  
                    IntToStr(A 1)   "  ;  "  
                    IntToStr(B 1)   "  ;  "  
                    IntToStr(C 1)   "  :" ;
                    RichEdit1->Text = RichEdit1->Text   "\n";
                } ;
            } ;
        };
    } ;
} ;
//---------------------------------------------------------------------------    
練習! 練習! 再練習!
------
嘿嘿嘿
系統時間:2024-05-02 21:08:45
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!