a824. CPE:Andy’s First Dictionary (UVa 10815)

簡單CPE

時間限制 2000 ms ・ 記憶體限制 256 MB

題目描述

Andy 想把文章中所有不同的單字整理成字典。單字是由連續英文字母組成的最長片段,可以含大寫或小寫;只有一個字母也算單字。比較時不分大小寫,例如 Apple、apple、APPLE 視為同一個單字。

輸入格式

輸入是一篇文字,最多 5000 行,每行最多 200 個字元,讀至檔案結束。不同單字的總數不超過 5000。

輸出格式

列出所有不同單字,每行一個。全部轉成小寫,依字母順序遞增排列。

原題:https://onlinejudge.org/external/108/10815.pdf

範例測資

範例輸入 1

Adventures in Disneyland
Two blondes were going to Disneyland when they came to a fork in the
road. The sign read: "Disneyland Left."
So they went home.

範例輸出 1

a
adventures
blondes
came
disneyland
fork
going
home
in
left
read
road
sign
so
the
they
to
two
went
were
when
請先登入後再提交程式碼

討論與題解

載入討論區…

更多