All words in the statement should have the same gender. After Petya's friend Vasya wrote instant messenger (an instant messaging program) that supported the Petya's language, Petya wanted to add spelling and grammar checking to the program. As Vasya was in the country and Petya didn't feel like waiting, he asked you to help him with this problem. Your task is to define by a given sequence of words, whether it is true that the given text represents exactly one sentence in Petya's language.
Input The first line contains one or more words consisting of lowercase Latin letters. The overall number of characters (including letters and spaces) does not exceed 105.
It is guaranteed that any two consecutive words are separated by exactly one space and the input data do not contain any other spaces. It is possible that given words do not belong to the Petya's language.
Output If some word of the given text does not belong to the Petya's language or if the text contains more that one sentence, print "NO" (without the quotes). Otherwise, print "YES" (without the quotes).
Sample test(s) input petr
output YES
input etis atis animatis etis atis amatis
output NO
input nataliala kataliala vetra feinites
output YES
应该是Div 1.有点麻烦。最初题意还看错了sad 7次才过掉。
题意: 现在有3种词,形容词,名词,动词,每种词有两种词性,每种词性对应一种后缀,现在给出一个句子的定义:要求是有一个合法单词或一个合法声明。
合法单词是指有一种上面的后缀;合法声明定义为:含有0个以上的形容词+一个名词+0个以上的动词(按形容词名词动词的顺序且所以的词的词性相同)
哎个判断条件就是了。。很容易漏点
#include
#include
#include
#include
#include
#include
#include
#include