標準水題一枚,先全部轉化成小寫,然後用個數組做個統計,看看是不是26個字母全有了就行了。
package com.codeforces.algorithm;
import java.io.PrintWriter;
import java.util.*;
public class Pangram {
public static void main(String []args){
Scanner cin = new Scanner(System.in);
PrintWriter cout = new PrintWriter(System.out);
while(cin.hasNext()){
int n = cin.nextInt();
String str = cin.next();
String ptr = str.toLowerCase();
int []num = new int[27];
for(int i=0;i<27;i++) num[i]=0;
for(int i=0;i<ptr.length();i++){
num[ptr.charAt(i)-'a']++;
}
boolean flag=true;
for(int i=0;i<26;i++){
if(num[i]==0){
flag=false;break;
}
}
if(flag){
cout.println("YES");
}
else{
cout.println("NO");
}
cout.flush();
}
cout.close();
}
}