有钱买不起房子2011-03-03TA获得超过4192个赞关注//错误在注释中#include<stdio.h>#include<string.h>//少个头文件#defineLINEMAX20voidsort(char**p);//在调用之前,函数必须声明voidmain(){inti;char**p,*pstr[5],str[5][LINEMAX];for(i=0;i<5;i++)pstr[i]=str[i];printf("Input5strings:\n");for(i=0;i<5;i++)scanf("%s",pstr[i]);p=pstr;sort(p);printf("stringssorted:\n");for(i=0;i<5;i++)//多个;printf("%s\n",pstr[i]);//少个;}voidsort(char**p){inti,j;char*temp;for(i=0;i<5;i++){for(j=i+1;j<5;j++){if(strcmp(*(p+i),*(p+j))>0){temp=*(p+i);*(p+i)=*(p+j);*(p+j)=temp;//多个*}}}}