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
108 0
|
5月前
|
机器学习/深度学习 存储 自然语言处理
SeACo-Paraformer
【6月更文挑战第14天】
202 6
|
6月前
|
机器学习/深度学习 人工智能 算法
PAI-TorchAcc
AI加速引擎PAI-TorchAcc
70 5
|
6月前
|
SQL 分布式计算 HIVE
ApacheHudi使用问题汇总(一)
ApacheHudi使用问题汇总(一)
56 0
PAUSE
PAUSE
105 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.
126 0
|
Web App开发
XPathHelper使用
XPathHelper使用
155 0
|
Linux
packetdrill
packetdrill工具安装
246 0
packetdrill
PathAnimation
原文:PathAnimation 使用Blend制作PathAnimation 1:选中Path转换为运动路径 2:选择目标对象   PathAnimation使用动态的Path PathAnimation动画在播放的时候,PahtGeometry是已经确定的,不会改变,不会实时的根据Pa...
905 0