📜  c 中的 panagram - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:28.327000             🧑  作者: Mango

代码示例1
#include
#include
void main()
{
    char str[100]="The quick brown fox jumps over the lazy dog";
    int i,value[26]={0},count=0;
    for(i=0;str[i]!='\0';i++)
    {
        if('a'<=str[i] && str[i]<='z')
        {
            count+=!value[str[i]-'a'];
            value[str[i]-'a']=1;
        }
        else if('A'<=str[i] && str[i]<='Z')
        {
            count+=!value[str[i]-'A'];
            value[str[i]-'A']=1;
        }
    }
    if(count==26)
    {
        printf("The String is a Pangram String.");
    }
    else
    {
        printf("The String is not a Pangram String.");
    }
    getch();
}