From 62a607648388ba5690efd5eb330f95760d502f9e Mon Sep 17 00:00:00 2001 From: Evan Carr Date: Fri, 23 Feb 2024 21:13:13 -0500 Subject: [PATCH] [C++] Add solution to Quick Brown Fox --- Solutions/Quick Brown Fox/quickbrownfox.cpp | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Solutions/Quick Brown Fox/quickbrownfox.cpp diff --git a/Solutions/Quick Brown Fox/quickbrownfox.cpp b/Solutions/Quick Brown Fox/quickbrownfox.cpp new file mode 100644 index 00000000..f14743da --- /dev/null +++ b/Solutions/Quick Brown Fox/quickbrownfox.cpp @@ -0,0 +1,27 @@ +#include +#include + +using namespace std; + +int main() { + int n; + cin >> n; + while(n--) { + int freq[26] = { 0 }; + string input; + getline(cin >> ws, input); + for(char letter : input) { + if(!isalpha(letter)) continue; + freq[tolower(letter) - 'a']++; + } + string missing = ""; + for(int i = 0; i < 26; ++i) { + if (freq[i] == 0) { + missing += 'a' + i; + } + } + if(missing != "") cout << "missing " << missing << "\n"; + else cout << "pangram" << "\n"; + } + return 0; +} \ No newline at end of file