#include #include #include #include #include #include using namespace std; void pr(int c) { if (c < 32) cout << " ^" << (char)(c + '@'); else if (c == 32) cout << " sp"; else if (c < 127) cout << " " << (char)c; else if (c == 127) cout << " dl"; else cout << " ??"; } void headings(int min, int max) { cout << " "; for (int i = min; i <= max; i += 1) if (i < 128) pr(i); else cout << i; cout << '\n'; } void gofor(string s, int min, int max, int f(int c)) { cout << setw(11) << s; for (int i = min; i <= max; i += 1) if (f(i)) cout << " T"; else cout << " -"; cout << '\n'; } void gofori(string s, int min, int max, int f(int c)) { cout << setw(11) << s; for (int i = min; i <= max; i += 1) cout << setw(3) << f(i); cout << '\n'; } void goforc(string s, int min, int max, int f(int c)) { cout << setw(11) << s; for (int i = min; i <= max; i += 1) pr(f(i)); cout << '\n'; } int main() { int step = 32; for (int a = 0, b = step - 1; a < 256; a += step, b += step) { headings(a, b); gofori("digittoint", a, b, digittoint); gofor("isalnum", a, b, isalnum); gofor("isalpha", a, b, isalpha); gofor("isascii", a, b, isascii); gofor("iscntrl", a, b, iscntrl); gofor("isdigit", a, b, isdigit); gofor("isgraph", a, b, isgraph); gofor("ishexnumber", a, b, ishexnumber); gofor("isideogram", a, b, isideogram); gofor("islower", a, b, islower); gofor("isnumber", a, b, isnumber); gofor("isphonogram", a, b, isphonogram); gofor("isspecial", a, b, isspecial); gofor("isprint", a, b, isprint); gofor("ispunct", a, b, ispunct); gofor("isrune", a, b, isrune); gofor("isspace", a, b, isspace); gofor("isupper", a, b, isupper); gofor("isxdigit", a, b, isxdigit); goforc("toascii", a, b, toascii); goforc("tolower", a, b, tolower); goforc("toupper", a, b, toupper); cout << "\n"; } }