有问题(排序),求帮助!!!!!!
题目:利用指针将n个字符串排序 #include "stdio.h"
#include "string.h"
void init(char *p[],int n)
{
int i;
printf("input %d's string:\n",n);
for (i=0;i<n;i++)
{
printf("%d\n",i);
p[i]=______;
scanf("%s",p[i]);
}
}
void sort(char *p[],int n)
{
int i,j;
char *q;
_________________
_________________
___________________
________________
}
void prints(char *p[],int n)
{
int i;
for (i=0;i<n;i++)
_______________;}
main()
{
char *str[20];
int n;
printf("input n:\n");
scanf("%d",&n);
init(str,n);
sort(str,n);
prints(str,n);
}
[ 本帖最后由 huwengui 于 2011-6-22 21:29 编辑 ]