panagram
Sun Sep 22 2024 09:48:19 GMT+0000 (Coordinated Universal Time)
Saved by
@CodeXboss
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
string checkPangram(const string& sentence) {
bool letters[26] = {false};
for (char ch : sentence) {
if (isalpha(ch)) {
int index = tolower(ch) - 'a';
letters[index] = true; // Mark this letter as present
}
}
for (bool present : letters) {
if (!present) {
return "not pangram";
}
}
return "pangram";
}
int main() {
string input;
getline(cin, input);
cout << checkPangram(input) << endl;
return 0;
}
content_copyCOPY
Comments