Pangram
来源:互联网 发布:淘宝追加好评长心吗 编辑:程序博客网 时间:2024/06/11 16:49
Description
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.
Sample Input
12toosmallword
NO
35TheQuickBrownFoxJumpsOverTheLazyDog
YES
#include<iostream>#include<string.h>using namespace std;int main(){int n,count[26],lena,i,j,flag=0;char a[120];memset(count,0,sizeof(count));cin>>n;cin>>a;strupr(a);if(n<26)cout<<"NO"<<endl;else{ lena=strlen(a);for(i=0;i<lena;i++){for(j=0;j<=25;j++){if(a[i]=='A'+j){count[j]++;break;}}}for(i=0;i<=25;i++){ if(count[i]==0) { flag=1; cout<<"NO"<<endl; break; } }if(!flag)cout<<"YES"<<endl;}return 0;}
- Pangram
- A Pangram
- A. Pangram
- Pangram(水题)
- Codeforces Pangram
- 520A Pangram【implement】
- Codeforces Round #295 A. Pangram
- Pangram(简单水题)
- Codeforces Round #295 A. 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
- Codeforces #295(Div 2) A Pangram、B Two Buttons、C DNA Alignment
- java Prim算法
- hdoj 1042 N!
- JS控制DOM的CSS样式
- bresenham直线,画圆算法(附OpenGL代码)
- java的五种单例设计模式
- Pangram
- 仿QQ打开“我”界面的滑动效果
- NGUI之UICamera
- C#拾遗之String类(一)
- Python基础06 循环
- hdoj 1098 Ignatius's puzzle
- 关于设置了LayoutAlgorithm.SINGLE_COLUMN后,某些手机的webview仍然无法适配图片的解决方案
- 在spring官网下载文档或jar包方法
- git 学习