strcmp的实现,简洁 int strcmp(const char *s,const char *t) { for(;*s==*t;++s,++t) if(*s==0) return 0; return (*s>*t)?1:-1; }