#include <stdio.h>
#include <stdlib.h>
char *type[128] =
{
[0 ... 47] = "punctuation",
[48 ... 57] = "digit",
[58 ... 64] = "punctuation",
[65 ... 90] = "letter",
[91 ... 96] = "punctuation",
[97 ... 122] = "letter",
[123 ... 127] = "punctuation",
};
int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("using %s <key>\n", argv[0]);
exit(-1);
}
char tmp = *argv[1];
printf("%c is %s\n", tmp, type[tmp]);
return 0;
}
表驱动法字符分类
最新推荐文章于 2022-04-07 08:58:24 发布