S002-AC.cc
838 Bytes
#include <iostream>
using namespace std;
void print_line(char c, string s, bool b)
{
cout << s << "('" << c << "') = ";
if (b) cout << "true" << endl;
else cout << "false" << endl;
}
int main()
{
char c;
bool letter,vowel,consonant,uppercase,lowercase,digit,test;
cin >> c;
letter = ((c > 64) && (c < 91)) || ((c > 96) && (c < 123));
vowel = (c == 65) || (c == 69) || (c == 73) || (c == 79) || (c == 85) || (c == 97) || (c == 101) || (c == 105) || (c == 111) || (c == 117);
consonant = !vowel && letter;
uppercase = (c > 64) && (c < 91);
lowercase = !uppercase && letter;
digit = (c > 47) && (c < 58);
print_line(c,"letter",letter);
print_line(c,"vowel",vowel);
print_line(c,"consonant",consonant);
print_line(c,"uppercase",uppercase);
print_line(c,"lowercase",lowercase);
print_line(c,"digit",digit);
return 0;
}