21960_FlowersFlourishfromFrance

2022-5-16 18:20| 发布者: Hocassian| 查看: 25| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505995372099-Problem List-采集的数据-后羿采集器.html

Pro.ID

21960

Title

Flowers Flourish from France

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21960

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Fiona has always loved poetry, and recently she discovered a fascinating poetical form. Tautograms are a special case of alliteration, which is the occurrence of the same letter at the beginning of adjacent words. In particular, a sentence is a tautogram if all of its words start with the same letter.

    For instance, the following sentences are tautograms:

    • Flowers Flourish from France

    • Sam Simmonds speaks softly

    • Peter pIckEd pePPers

    • truly tautograms triumph

    Fiona wants to dazzle her boyfriend with a romantic letter full of this kind of sentences. Please help Fiona to check if each sentence she wrote down is a tautogram or not.

    输入

    Each test case is given in a single line that contains a sentence. A sentence consists of a sequence of at most 50 words separated by single spaces. A word is a sequence of at most 20 contiguous uppercase and lowercase letters from the English alphabet. A word contains at least one letter and a sentence contains at least one word.

    The last test case is followed by a line containing only a single character '*' (asterisk).

    输出

    Description

    Fiona has always loved poetry, and recently she discovered a fascinating poetical form. Tautograms are a special case of alliteration, which is the occurrence of the same letter at the beginning of adjacent words. In particular, a sentence is a tautogram if all of its words start with the same letter.

    For instance, the following sentences are tautograms:

    • Flowers Flourish from France

    • Sam Simmonds speaks softly

    • Peter pIckEd pePPers

    • truly tautograms triumph

    Fiona wants to dazzle her boyfriend with a romantic letter full of this kind of sentences. Please help Fiona to check if each sentence she wrote down is a tautogram or not.

    Input

    Each test case is given in a single line that contains a sentence. A sentence consists of a sequence of at most 50 words separated by single spaces. A word is a sequence of at most 20 contiguous uppercase and lowercase letters from the English alphabet. A word contains at least one letter and a sentence contains at least one word.

    The last test case is followed by a line containing only a single character '*' (asterisk).

    Output

    For each test case output a single line containing an uppercase 'Y' if the sentence is a tautogram, or an uppercase 'N' otherwise.

    Sample Input

    Flowers Flourish from France
    Sam Simmonds speaks softly
    Peter pIckEd pePPers
    truly tautograms triumph
    this is NOT a tautogram
    *

    Sample Output

    Y
    Y
    Y
    Y
    N

    Source

    样例输入

    Flowers Flourish from France
    Sam Simmonds speaks softly
    Peter pIckEd pePPers
    truly tautograms triumph
    this is NOT a tautogram
    *

    样例输出

    Y
    Y
    Y
    Y
    N

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部