#include <iostream>
#include <string>
bool pangram(std::string s)
{
int letters = 0;
for (std::string::iterator it = s.begin(); it != s.end(); ++it)
{
int ltr = (*it | 32) - 97;
if ((unsigned)ltr < 26) letters |= (1 << ltr);
}
//std::cout << std::hex << letters << std::endl;
return letters == 0b11111111111111111111111111; // all 26 (0x3ffffff)
}
int main()
{
std::string s;
std::cout << "enter a sentence, to find out whether it is a pangram (all letters):";
std::getline(std::cin, s);
std::cout << (pangram(s) ? "yup" : "nope") << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKYm9vbCBwYW5ncmFtKHN0ZDo6c3RyaW5nIHMpCnsKICAgIGludCBsZXR0ZXJzID0gMDsKICAgIGZvciAoc3RkOjpzdHJpbmc6Oml0ZXJhdG9yIGl0ID0gcy5iZWdpbigpOyBpdCAhPSBzLmVuZCgpOyArK2l0KQogICAgewogICAgICAgIGludCBsdHIgPSAoKml0IHwgMzIpIC0gOTc7CiAgICAgICAgaWYgKCh1bnNpZ25lZClsdHIgPCAyNikgbGV0dGVycyB8PSAoMSA8PCBsdHIpOwogICAgfQogICAgLy9zdGQ6OmNvdXQgPDwgc3RkOjpoZXggPDwgbGV0dGVycyA8PCBzdGQ6OmVuZGw7CiAgICByZXR1cm4gbGV0dGVycyA9PSAwYjExMTExMTExMTExMTExMTExMTExMTExMTExOyAvLyBhbGwgMjYgKDB4M2ZmZmZmZikKfQoKaW50IG1haW4oKQp7CiAgICBzdGQ6OnN0cmluZyBzOwogICAgc3RkOjpjb3V0IDw8ICJlbnRlciBhIHNlbnRlbmNlLCB0byBmaW5kIG91dCB3aGV0aGVyIGl0IGlzIGEgcGFuZ3JhbSAoYWxsIGxldHRlcnMpOiI7CiAgICBzdGQ6OmdldGxpbmUoc3RkOjpjaW4sIHMpOwogICAgc3RkOjpjb3V0IDw8IChwYW5ncmFtKHMpID8gInl1cCIgOiAibm9wZSIpIDw8IHN0ZDo6ZW5kbDsKICAgIHJldHVybiAwOwp9Cg==