You are viewing a single comment's thread. Return to all comments →
My solution in c:
int main() { int a[26]={0}; int i,n,c=0; char *s=(char *)malloc(10240*sizeof(char)); scanf("%[^\n]s",s); for(i=0;s[i]!='\0';i++) { int k=s[i]; if(k>=97 && k<=122) { n=k-97; a[n]++; } else if(k>=65&&k<=91) { n=k-65; a[n]++;
} } for(i=0;i<=25;i++) { if(a[i]!=0) c++; } if(c==26) { printf("pangram"); } else printf("not pangram"); return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
My solution in c:
include
include
include
include
int main() { int a[26]={0}; int i,n,c=0; char *s=(char *)malloc(10240*sizeof(char)); scanf("%[^\n]s",s); for(i=0;s[i]!='\0';i++) { int k=s[i]; if(k>=97 && k<=122) { n=k-97; a[n]++; } else if(k>=65&&k<=91) { n=k-65; a[n]++;
}