武兵 7933 字 5個月前

ICON語言

(6 / 7)
⚡ 登入後報錯可獲 3天VIP 免廣告——立即登入

cesatablecontainingacountofthewordsthatappearintheinputfile:

words:=table(0)

whileline:=read()do

line?whiletab(upto(&letters))do

words[tab(many(&letters))]+:=1

Herethedefaultvalueforeachwordis0,asgivenintable(0),and+:=isanaugmentedassignmentoperationusedtoincrementthevalues.Thereareaugmentedassignmentoperationsforallbinaryoperators.

AlistcanbeobtainedfromatableTbythefunctionsort(T,1).Theformofthelistdependsonthevalueofi.Forexample,ifiis3,thelistcontainsalternatekeysandtheircorrespondingvaluesinT.Forexample,

wordlist:=sort(words,3)

whilewrite(pop(wordlist),\":\",pop(wordlist))

writesthewordsandtheircountsfromthetablewords.

5.GraphicsFacilitie

Iconsupportshigh-levelgraphicsfacilities:

Windowscanbeopenedandclosedasdesired.

Textcanbewrittentowindowsinavarietyoftypefacesandsizes,includingproportional-widthfaces.

Charactersfromthekeyboardscanbeprocessedastheyaretyped.

Points,lines,polygons,circles,ares,andsmoothcurvescanbefreelymixedwithtext.

Colorscanbeusedforbothtextandgraphics.

Imagefilescanbereadandwritten.

Formoreinformation,seeReference3.

6.AnExample

Thefollowingprogram,whichproducesaconcordanceofthewordsfromaninputfile,illustratestypicalIconprogrammingtechniques.Althoughnotallthefeaturesinthisprogramaredescribedinprevioussections,thegeneralideashouldbeclear.

globaluses,lineno,width

proceduremain(args)

width:=15#widthofwordfield

uses:=table()

lineno:=0

everytabulate(words())#tabulateallcitations

output()#printthecitations

end

ᴏᴏᴘ.ᴛᴡ 呈現最新的小說章節

#Addlinenumbertocitationsforword

proceduretabulate(word)

\/uses[word]:=set()

insert(uses[word],lineno)

return

end

#Generatewords

procedurewords()

{od)(daer=:enilelihw

1=:+onenil

)enil,"\"\,)6,onenil(thgir(etirw

{od))srettel&(otpu(batelihw?)enil(pam

))srettel&(ynam(bat=:s

sdrowtrohspiks#sdnepsusneht3=>s*fi

dne

stluserehttnirP#

)(tuptuoerudecorp

enilknalb#)(etirw

snoitatictros#)3,sesu(tros=:sesu

{od)sesu(teg=:drowelihw

"\"\=:enil

))sesu(teg(tros=:srebmun

"\,"\||)srebmun(teg=:||enilelihw

)]2-:1[enil,)htdiw,drow(tfel(etirw

dne

emittsrifehT.srebmunenilfotesgnidnopserrocasahyekyrevE.sdrowehtybdeyeksi,sesu,elbatA.dedracsideradna"\esion"\ebotderedisnoceragnolsretcarahceerhtnahtsselsdroW.enilehtnidrowyrevesessecorpdna,rebmunenilgniyfitnedinahtiwtuotisetirw,enilasdaermargorpehT


✅ 付款功能已修復,現在可以正常購買了 — 支援信用卡 · Apple Pay · Google Pay · WebATM · ATM 轉帳
😤 廣告總在最入戲的時候跳出來?
月付 $5 USD,升級 VIP 後全站所有頁面廣告立即全關——
不是只有這本書,是整個 oop.tw 每一頁、每一章,從此一路讀到底不被打斷。 $5 USD ≈ 一杯珍奶的錢,換一整個月零廣告清爽閱讀 · 隨時可取消
✅ 全站廣告全關 ✅ 工口專區全本解鎖 ✅ 月卡 $5 USD · 季卡 $13 USD · 年卡 $45 USD
⭐ 登入 / 免費註冊後升級
加我 LINE 好友,分享好書不錯過
第一時間獲得新書推薦、書單更新通知
立即加入
上一頁 書頁/目錄
/ 7 頁
下一頁
為本書評分(每位讀者可評一次,提交後無法修改)
發表評論
以 匿名讀者 身份發表
讀者評論