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;
}

总结

水题,不解释


目录
相关文章
|
XML Java 数据格式
常用的xpath
常用的xpath
106 0
|
5月前
PAT 1001 和 1002 A+B问题
PAT 1001 和 1002 A+B问题
|
6月前
|
机器学习/深度学习 人工智能 算法
PAI-TorchAcc
AI加速引擎PAI-TorchAcc
70 5
|
6月前
|
SQL 分布式计算 数据库
ApacheHudi使用问题汇总(二)
ApacheHudi使用问题汇总(二)
110 0
|
XML Java 数据库连接
parameterType是必须写的吗?
xml中没有配置parameterType,但是这是正确的,因为mybatis能自动识别,但返回值类型不能不写,因为mybatis需要将获得结果封装到相应的类中,查询的字段与类的属性需要一致。
380 0
parameterType是必须写的吗?
|
SQL Java 数据库连接
JPA
JPA
162 1
PAT有几个pat
字符串APPAPT中包含了两个单词“PAT”,其中第一个PAT是第2位§,第4位(A),第6位(T);第二个PAT是第3位§,第4位(A),第6位(T)。 现给定字符串,问一共可以形成多少个PAT?
127 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.
123 0
|
Web App开发
XPathHelper使用
XPathHelper使用
152 0