不知道怎么搞得,今天一天都不舒服,哎,太累了,一天都不想起床
思路:统计字符串中是否包含所有字母(不分大小写)
AC代码:
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int a[26];
char str[105];
int main() {
int n;
while(scanf("%d", &n) != EOF) {
memset(a, 0, sizeof(a));
scanf("%s", str);
for(int i = 0; str[i] != '\0'; i++) {
if(str[i] <= 'z' && str[i] >= 'a') a[str[i] - 'a'] = 1;
else if(str[i] <= 'Z' && str[i] >= 'A') a[str[i] - 'A'] = 1;
}
int ans = 0;
for(int i = 0; i < 26; i++) ans += a[i];
if(ans == 26) printf("YES\n");
else printf("NO\n");
}
return 0;
}