1:字符串首字母从大到小排序:
#include<stdio.h>
#include<string.h>
int sort(char *name[],int n);
int print(char *name[],int n);
int main()
{
char *name[] ={"Fasd.com","www.asdasd.com","home.qwew.com","Fvfd.com/dz"};
int n=4;
sort(name,n);
print(name,n);
}
int sort(char *name[],int n)
{
char *temp;
int i,j,k;
for(i=0;i<n-1;i++)
{
k=i;
for(j=i+1;j<n;j++)
{
if(strcmp(name[k],name[j]))
{
k=j;
}
if(k!=i)
{
temp=name[i];
name[i]=name[k];
n