You are viewing a single comment's thread. Return to all comments →
I took a similar approach. I used map to count the number of letters. string s; getline(cin,s);
map<char,int> letter; for(int i=0; i<s.size(); i++) { if(isalpha(s.at(i))) letter[tolower(s.at(i))]++; } letter.size()>=26 ? cout<<"pangram" : cout<<"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 →
I took a similar approach. I used map to count the number of letters. string s; getline(cin,s);