当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2872:Spelling Be

题目描述
It's a simple requirement your company has, really every document should be spell-checked before it's sent out to a customer. Unfortunately, while word processing documents are easily spell-checked, your employees have not been checking email every time they send out a message. So you've come up with a little improvement. You are going to write a program that will check email on its way out. You will spell-check each message, and if you find any spelling errors, it will be returned to the sender for correction.

When you announced this plan, one of your coworkers fell off their chair laughing, saying that you couldn't possibly anticipate every name, technical acronym, and other terms that might appear in an email. Undaunted, however, you are going to test-run your code with an online dictionary and some sample emails you have collected.
输入解释
The input consists of two sections, the dictionary and the emails. The first line of input specifies the number of words in the dictionary, followed by that many lines, with one word per line. There is no whitespace before, after, or in any words,although there may be apostrophes or hyphens in the words, which are considered part of the word (i.e. "bobs" is different than "bob's". There will be no duplicate words. All words will be in lower case.

Following that are the emails. The first line of this section has the number of emails in the input. Following that line begins the first email. It has been preprocessed, so it consists of one word per line, with no punctuation (other than apostrophes and hyphens) or whitespace, and all words are in lower case. The last word in the email is followed by a line with only "-1". Each email will have at least one word.
输出解释
For each email, you must either print:

Email X is spelled correctly.

where Xbegins with 1 and counts up. Or, if a word is found that is not in the dictionary, print out:

Email X is not spelled correctly.

followed by a list of unknown words in the order that you find them, one per line. If an unknown word is found multiple times, it should be printed multiple times.

There are no spaces between datasets. Following the output for the final dataset, print a line stating "End of Output".
输入样例
6
alice
am
bitterly
i
leaving
you
1
dear
bob
i
am
leaving
you
bitterly
alice
-1
输出样例
Email 1 is not spelled correctly.
dear
bob
End of Output

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Mid-Atlantic 2002

源链接: POJ-2872

最后修改于 2020-10-29T06:46:24+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536