If I ever pass kidney stones, I'll let you know how it compares.
The beast is unleashed:
#include <iostream>
using namespace std;
int main()
{
char x[27];
char c = 'a';
for (int i = 0; i < 26; i++)
{
x[i] = c;
c++;
}
string str;
cout << "Please enter a string: ";
getline(cin, str);
bool pangram = false;
for(int i = 0; i < str.length(); i++)
{
str[i] = tolower(str[i]);
}
for(int i = 0; i < 26; i++)
{
if (str.find(x[i]) == -1)
{
pangram = true;
break;
}
}
if(pangram)
cout << "The string you entered is not a pangram.";
else
cout << "The string you entered is indeed a pangram.";
return 0;
}
This post has been edited by Raynes: 07 April 2010 - 01:01 AM

New Topic/Question
Reply




MultiQuote















|