You are viewing a single comment's thread. Return to all comments →
int main() { string s;
// New --- getline(cin, s); bool isAPangram = true; string alphabet = "abcdefghijklmnopqrstuvwxyz"; // New --- isAPangram = std::all_of(alphabet.begin(), alphabet.end(), [s](char i){ char upperCase = toupper(i); bool hasLetter = count(s.begin(), s.end(),i)>0; hasLetter |= count(s.begin(), s.end(),upperCase)>0; //cout <<i<<hasLetter; return hasLetter;}); if (isAPangram) { cout<<"pangram"; } else{ 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 →
int main() { string s;
}