ids.c
上传用户:shmaik
上传日期:2014-06-01
资源大小:45093k
文件大小:1k
- static char rcsid[] = "$Id: H:/drh/idioms/book/RCS/str.doc,v 1.10 1996/06/26 23:02:01 drh Exp $";
- #include <stdlib.h>
- #include <stdio.h>
- #include "fmt.h"
- #include "str.h"
- int main(int argc, char *argv[]) {
- char line[512];
- static char set[] = "0123456789_"
- "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- Fmt_register('S', Str_fmt);
- while (fgets(line, sizeof line, stdin) != NULL) {
- int i = 1, j;
- while ((i = Str_upto(line, i, 0, &set[10])) > 0){
- j = Str_many(line, i, 0, set);
- Fmt_print("%Sn", line, i, j);
- i = j;
- }
- }
- return EXIT_SUCCESS;
- }