- Simply Syntax
In the land of Hedonia the official language is Hedonian. A Hedonian professor had noticed that many of her students still did not master the syntax of Hedonian well. Tired of correcting the many syntactical mistakes, she decided to challenge the students and asked them to write a program that could check the syntactical correctness of any sentence they wrote. Similar to the nature of Hedonians, the syntax of Hedonian is also pleasantly simple. Here are the rules:
The only characters in the language are the characters p through z and N, C, D, E, and I.
Every character from p through z is a correct sentence.
If s is a correct sentence, then so is Ns.
If s and t are correct sentences, then so are Cst, Dst, Est and Ist.
Rules 0. to 3. are the only rules to determine the syntactical correctness of a sentence.
You are asked to write a program that checks if sentences satisfy the syntax rules given in Rule 0. - Rule 4.
The input consists of a number of sentences consisting only of characters p through z and N, C, D, E, and I. Each sentence is ended by a new-line character. The collection of sentences is terminated by the end-of-file character. If necessary, you may assume that each sentence has at most 256 characters and at least 1 character.
The output consists of the answers YES for each well-formed sentence and NO for each not-well-formed sentence. The answers are given in the same order as the sentences. Each answer is followed by a new-line character, and the list of answers is followed by an end-of-file character.
- 学院 2019 AI开发者大会
- 下载 实现简单的文件系统
- 下载 MIPS单周期CPU-组成原理实验-华中科技大学
- 下载 2019数学建模A题高压油管的压力控制 省一论文即代码
- 下载 基于QT和OpenCV的五子棋实现源码
- 学院 Git 实用技巧
- 学院 实用主义学Python（小白也容易上手的Python实用案例）
- 学院 三个项目玩转深度学习（附1G源码）
- 博客 Java基础知识面试题（2020最新版）
- 下载 Python界面版学生管理系统
- 学院 Vue.js 2.0之全家桶系列视频课程
- 博客 JAVA初级工程师面试36问(完结)
- 下载 java jdk 8 帮助文档 中文 文档 chm 谷歌翻译
- 博客 我以为我对Mysql事务很熟，直到我遇到了阿里面试官
- 下载 智鼎(附答案).zip
- 下载 Visual Assist X 破解补丁
- 学院 150讲轻松搞定Python网络爬虫
- 下载 JavaWEB商城项目(包括数据库)
- 学院 Python数据挖掘简易入门
- 学院 一学即懂的计算机视觉（第一季）
- 学院 软件测试2小时入门
- 学院 初级玩转Linux+Ubuntu(嵌入式开发基础课程)
- 学院 2019 Python开发者日-培训
- 学院 快速入门Android开发 视频 教程 android studio
- 学院 机器学习初学者必会的案例精讲
- 学院 4小时玩转微信小程序——基础入门与微信支付实战