Pangram

简介: Pangram

文章目录

一、Pangram

总结


一、Pangram

本题链接:Pangram


题目:

A. Pangram

time limit per test2 seconds

memory limit per test256 megabytes

inputstandard input

outputstandard output

A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.


You are given a string consisting of lowercase and uppercase Latin letters. Check whether this string is a pangram. We say that the string contains a letter of the Latin alphabet if this letter occurs in the string in uppercase or lowercase.


Input

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of characters in the string.


The second line contains the string. The string consists only of uppercase and lowercase Latin letters.


Output

Output “YES”, if the string is a pangram and “NO” otherwise.


Examples

input

12

toosmallword

output

NO

input

35

TheQuickBrownFoxJumpsOverTheLazyDog

output

YES

本博客给出本题截图

image.png

题意:输入一个字符串,判断是否出现了所有字母(不区分大小写)

AC代码

#include <iostream>
#include <string>
#include <set>
using namespace std;
int main()
{
    int n;
    cin >> n;
    if (n < 26)
    {
        puts("NO");
        exit(0);
    }
    else
    {
        string a;
        cin >> a;
        set<char> s;
        for (int i = 0; i < n; i ++ ) 
        {
            if (a[i] >= 'A' && a[i] <= 'Z')
                a[i] = a[i] - 'A' + 'a';
            s.insert(a[i]);
        }
        if (s.size() == 26) puts("YES");
        else puts("NO");
    }
    return 0;
}

总结

水题,不解释


目录
相关文章
|
4月前
|
API Android开发 开发者
NavigableListDetailPaneScaffold
【9月更文挑战第12天】
41 5
|
7月前
PAT 1001 和 1002 A+B问题
PAT 1001 和 1002 A+B问题
|
8月前
|
SQL 分布式计算 数据库
ApacheHudi使用问题汇总(二)
ApacheHudi使用问题汇总(二)
128 0
|
8月前
|
缓存 Java API
深入理解JPA
深入理解JPA
238 0
|
8月前
|
机器学习/深度学习 分布式计算 算法
SparkMllib介绍
SparkMllib介绍
74 0
3.3 Path
3.3 Path
97 0
PAUSE
PAUSE
113 0
|
XML 数据格式
一起来了解XPath吧!
一起来了解XPath吧!
122 0
|
算法
PAT条条大路通罗马
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.
132 0