#include <stdio.h> #include <string.h> #define LEN 1024 void main() { char s[LEN] = ""; int i; while(1) { printf("字符串:"); gets(s); printf("输出: "); int len = strlen(s); for(i=0; i< len;i++) printf("%02X ",(unsigned char)s[i]); printf(" -------------------------------------------------------------------------------- "); } }