精華區beta NTUScout 關於我們 聯絡資訊
※ 引述《SmallTACO (*乖者違背常理也*)》之銘言: : 謝耳排序法也是... : int n=320*320; : int Part=n/2; : do : { : for(i=0 ;i<n-Part;i++) : { : if(numbers[i]>numbers[i+Part]) : { : swap(numbers[i],numbers[i+Part]); : j=i; : if(j>Part) : { : do : { : swap(numbers[j],numbers[j-Part]); : j=j-Part; : if(j<=Part) ^^^^^^^ 這個等號好像會有問題吧... 這又是basic轉換到c++的bug了 ><~ : break; : }while(j>Part,numbers[j-Part]>numbers[j]); : } : } : } : Part=Part/2; : }while(Part>=1); -- 錢多事少離家近 位高權重責任輕 每日睡到自然醒 薪水領到手抽筋 逢年過節拿獎金 別人加班我加薪 秘書妖豔員工齊 有禍歸人功歸己 歐美亞非加南極 出差旅遊任我行