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

有關於氣泡排序法的問題~

尚未結案
tai1688
一般會員


發表:9
回覆:12
積分:4
註冊:2005-03-15

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-03-15 11:12:51 IP:24.205.xxx.xxx 未訂閱
#include
#define size 10
int main()
{    
    int counter,i;
        double arr[size];
        counter=0;
        {
        printf("Do not enter more than %d values please\n\n",size);
        printf("Please enter value (-1 to quit):");
        scanf("%lf",&value);
        while (value !=-1)
        {
                arr[counter]=value;
                printf("Please enter value (-1 to quit):");
                scanf("%lf",&value);
                counter=counter 1;
        }
        
        printf("%d values were entered\n",counter);
        printf("These values are:\n");
        i=0;
        while (i
我的這個程式已能把我輸入的數字輸出來,但我想再把我輸出來的數字由小排到大,由大排到小,共3行,求助各位高手幫忙,感激不進~^^~     
        
dllee
站務副站長


發表:321
回覆:2519
積分:1711
註冊:2002-04-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-03-15 13:09:02 IP:220.139.xxx.xxx 未訂閱
using "bubble sort" keyword, you can get may relatived link from http://www.google.com http://www.google.com/search?q=bubble sort and many of them provide C sample code, even with visual graph, like: http://www.cs.princeton.edu/~ah/alg_anim/gawain-4.0/BubbleSort.html BTW, this question is nothing to do with C#Builder... < href="http://free.greenworld.com.tw/~dllee/" target="blank">吃軟也吃硬 dllee.ktop.com.tw StatPlus 系統資源監測器 @ KTOP OpenPLC - IEC 61131-3 geOShell XP Like 中文版
------
http://www.ViewMove.com
系統時間:2024-05-07 10:43:39
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!