说明: c++编写的字符串排序 #include #include #include #include #define N 10/* 设定要输入的字符串个数,可更改 */ /*int cmp(char *p1,char *p2) /* 字符串比较函数 */ {int i=0; while (*(p1+i)==*(p2+i)) if (*(p1+i++)=='\0') return 0; / /这里是先判断*(p1+i)=='\0',然后再是i++ return (*(p1+i)-*(p2+i)); }
<shierhao> 上传 | 大小:967byte