[問題] 演算法 Programming Assignment #1

看板NTUEE110HW作者 (CJ Cat)時間15年前 (2008/10/13 00:37), 編輯推噓2(203)
留言5則, 2人參與, 最新討論串1/1
題目裡面寫到 The output contains a number indicating the total number of words followed by a list of words (sorted in alphabetic order). ^^^^^^^^^^^^^^^^^^^^^^^^^^ 然後下面有提供這個 output example 10 a 2 1 4 IC 1 6 Pentium 1 2 chip 1 3 circuit 1 8 contains 1 9 integrated 1 7 state-of-the-art 1 5 transistors 1 10 我想說的是,他並沒有 "sorted in alphabetic order"啊 請問題目"sorted in alphabetic order"的意思到底是什麼呢? 還是說是output example有誤? -- CJ Cat = Croa'J Cat = Cockroach Cat = 西街凱特 = 蜚蠊貓 = 蟑螂貓 Blog http://cjcat.blogspot.com Gallery http://cjcat2266.deviantart.com ptt2 Board CJWorkshop - 阿多比閃光(Adobe Flash)研討區 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.88.117

10/13 09:35, , 1F
應該是先照次數排 一樣的再照字母排的意思吧
10/13 09:35, 1F

10/13 22:11, , 2F
可是IC和Pentium不應該排在chip前面啊
10/13 22:11, 2F

10/14 00:03, , 3F
因為大寫的ascii code比小寫小 所以string直接比大小就會是這
10/14 00:03, 3F

10/14 00:03, , 4F
個結果吧
10/14 00:03, 4F

10/14 00:09, , 5F
原來是這樣,感謝老左 :)
10/14 00:09, 5F
文章代碼(AID): #18yYVRtH (NTUEE110HW)