第五讲 字符串处理
#include iostream #include stdio.h #include stdlib.h #include string.h using namespace std; inline void InitMap(char *map) { for (int i = 0; i = 9; i++) map[i + 0] = i; map[A] = map[B] = map[C] = 2; map[D] = map[E] = map[F] = 3; map[G] = map[H] = map[I] = 4; map[J] = map[K] = map[L] = 5; map[M] = map[N] = map[O] = 6; map[P] = map[R] = map[S] = 7; map[T] = map[U] = map[V] = 8; map[W] = map[X] = map[Y] = 9; } int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { char map[256]; c
原创力文档

文档评论(0)