Skip to content

Instantly share code, notes, and snippets.

@Raynes
Created April 6, 2010 23:15
Show Gist options
  • Select an option

  • Save Raynes/358257 to your computer and use it in GitHub Desktop.

Select an option

Save Raynes/358257 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
char x[27];
char c = 'a';
int main()
{
for (int i = 0; i < 26; i++) {
x[i] = c;
c++;
}
string str;
cout << "Please enter a string: ";
cin >> str;
bool pangram;
size_t found;
for(int i = 0; i < 26; i++) {
found = str.find(x[i]);
if (found != string::npos){
pangram = true;
}
else {
cout << x[i];
pangram = false;
break;
}
}
if(pangram == 0)
cout << "String is not a pangram.";
else
cout << "String is indeed a pangram.";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment