Created
April 3, 2020 14:11
-
-
Save r4nx/c52de53d723f1d8dea1d28f4beb173b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <array> | |
| #include <algorithm> | |
| #include <cctype> | |
| using namespace std; | |
| int main() | |
| { | |
| string sentence; | |
| getline(cin, sentence); | |
| array<bool, 26> presence; | |
| for (auto c : sentence) { | |
| c = toupper(c); | |
| if (c < 'A' || c > 'Z') | |
| continue; | |
| presence[c - 'A'] = true; | |
| } | |
| cout << "The sentence is " | |
| << (all_of( | |
| presence.cbegin(), | |
| presence.cend(), | |
| [](bool x) { return x; }) ? "" : "not ") | |
| << "a panagram." | |
| << endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment