You are viewing a single comment's thread. Return to all comments →
A simpler way to complete this problem would be to convert all the upper case letters to lower case letters. Here is my solution.
char s[1000]; fgets(s,1000,stdin); for(int i=0; s[i]!='\0';i++) s[i]=tolower(s[i]); //converted to lower case int counter=0; for(int a=97;a<=122;a++) { for(int i=0; s[i]!='\0';i++) if((int)s[i]==a) {counter++; break;} //compares the //ASCII value } if(counter==26) cout<<"pangram"; else cout<<"not pangram";
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 →
A simpler way to complete this problem would be to convert all the upper case letters to lower case letters. Here is my solution.