You are viewing a single comment's thread. Return to all comments →
int main() { int i,j,k,alp[26]={0}; char str[1000]; scanf("%s",str); for(i=0;str[i]!='\0';i++) { str[i] = tolower(str[i]); k=str[i]-'a'; alp[k]++; } for(j=0;j<26;j++) { if(alp[j]==0) { printf("not pangram"); return 0; } } printf("pangram"); return 0; }
I wonder why is this not working for all test cases?Help anyone?
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 →
int main() { int i,j,k,alp[26]={0}; char str[1000]; scanf("%s",str); for(i=0;str[i]!='\0';i++) { str[i] = tolower(str[i]); k=str[i]-'a'; alp[k]++; } for(j=0;j<26;j++) { if(alp[j]==0) { printf("not pangram"); return 0; } } printf("pangram"); return 0; }
I wonder why is this not working for all test cases?Help anyone?