A. Pangram
来源:互联网 发布:弹幕娘软件 编辑:程序博客网 时间:2024/06/06 04:57
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.
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 "YES", if the string is a pangram and "NO" otherwise.
12toosmallword
NO
35TheQuickBrownFoxJumpsOverTheLazyDog
YES
解题说明:此题为水题,简单判断26个字母是否都出现过
#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<string>#include<cmath>#include<cstdlib>using namespace std;int main(){int n,i;scanf("%d",&n);char s[1000];for(i=0;i<n;i++){scanf(" %c",&s[i]);}int a[26]={0};for(i=0;i<n;i++){if(s[i]>'Z'){s[i]=s[i]-32;}a[s[i]-'A']=1;}for(i=0;i<26;i++){if(a[i]!=1){break;}}if(i==26){printf("YES\n");}else{printf("NO\n");}return 0;}
- A Pangram
- A. Pangram
- 520A Pangram【implement】
- Codeforces Round #295 A. Pangram
- Codeforces Round #295 A. Pangram
- Pangram
- Codeforces Round #295 (Div. 2) -- A. Pangram
- Codeforces Round #295 (Div. 2) A. Pangram
- Codeforces Round #295 (Div. 2), problem: (A) Pangram
- codeforces——520A——Pangram
- Pangram(水题)
- Codeforces Pangram
- Codeforces #295(Div 2) A Pangram、B Two Buttons、C DNA Alignment
- Pangram(简单水题)
- a
- a
- a
- a
- 学习MFC的记录
- myeclipse 生成JAR包并引入第三方包
- 设计一个线程安全的类
- 《鸟哥的Linux私房菜》读书笔记6——其它帮助/说明文档
- 利用scm manager 创建git server
- A. Pangram
- c#和node.js交互,edge库的使用,node.js执行c#代码
- flex应学知识点
- (转)Python_Class总结(试验Markdown发图和代码)
- IOS 屏幕旋转Orientation总结
- HDU 2639 Bone Collector II
- ::运算符
- oracle闲暇一刻一:第一次数据导入
- Makefile的用法