编程介的小学生 2017-04-10 08:55 采纳率: 20.5%
浏览 803
已采纳

Netiquette

Description

Mr. Manners teaches netiquette ("net etiquette", particularly as it applies to email) at the local community college. There are many different aspects to proper netiquette, including courtesy, correct spelling, and correct grammar. Through experience Mr. Manners has found that his college's email system does a good job of catching most spelling and grammatical errors, and he's also found that most of his students are courteous. So there are four violations of netiquette that Mr. Manners pays careful attention to, and he's devised a quick way to test for them. A message is suspicious if it contains any of the following:
two adjacent uppercase letters,
(because you might be SHOUTING)
a digit adjacent to a letter,
(because you might be l33t, d00d)
an isolated character other than a, A, or I,
(because u r probably abbreviating words; the spell checker doesn't catch this for some reason)
two adjacent punctuation marks, unless one of them is a double quote (the character ").
(because you might be using an emoticon :-)

For this problem, all characters in an email message are printable ASCII characters with codes in the range 32..126 (inclusive). A punctuation mark is any character other than a letter, digit, or space. Two characters are adjacent if they are right next to each other, with no characters in between. An isolated character is one whose only adjacent characters (if any) are spaces. Your job is to write a program that can tell if a one-line email message is suspicious.

Input

The input consists of one or more email messages, followed by a line containing only # that signals the end of the input. Each message is on a line by itself, does not begin or end with a space, and does not contain consecutive spaces. End-of-line characters occur at the end of every line (of course), but they are not considered to be part of the message. A message will contain 1..80 characters.
Output

For each message, output suspicious if it meets one or more of the four criteria defined above, and output OK otherwise. In the examples below, the second email meets all four criteria, and the fourth and sixth emails meet one criterion each.
Sample Input

"This is a safe message," said 50 wise men.
DON'T b l8 for the Apple ][ user's group meeting.
I ate at "Al's Big Burritos" for lunch!
It's not OK to burp at your grandmother.
BuT YoU CaN Do ThIs, YoU KnOw.
We 8 eight oranges.
#
Sample Output

OK
suspicious
OK
suspicious
OK
suspicious

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-27 06:20
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB怎么通过柱坐标变换画开口是圆形的旋转抛物面?
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿