文章目录
一、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
本博客给出本题截图:
题意:输入一个字符串,判断是否出现了所有字母(不区分大小写)
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; }
总结
水题,不解释