结果又错啦!字符串排序,新手求助啊
void c(char p[3][100]){
char b[100];int i,j;
for(i=0;i<2;i++){
for(j=0;j<2-i;j++)
if(strcmp(*p+j,*p+j+1)<0){strcpy(b,*p+j);strcpy(*p+j,*p+j+1);strcpy(*p+j+1,b);}
}
for(j=0;j<3;j++)puts(*p+j);
}
就是用冒泡法来为字符串排序,结果很奇怪啊!想不出来啊!多谢啦
