输入十个字符,用选择法对字符进行降序输出,这个程序请问怎么改




```#include<stdio.h>
#include<string.h>
void jiang_xu(char a[],int n)
{
    int i,j;
    for(i=0;i<n-1;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(strcmp(a[i],a[j])<0)
            {
                char *m=a[i];
                a[i]=a[j];
                a[j]=m;
            }
        }
    }
}
int main()
{
    char a[10];
    int i;
    for(i=0;i<10;i++)
    scanf("%c",&a[i]);
    xuan_ze(a,10);
    for(i=0;i<10;i++)
    {
        printf("%c ",a[i]);
    }
    return 0;
}
```c


编译器错误提醒:
10 4 F:\待改错误\2-4.c [Warning] passing argument 1 of 'strcmp' makes pointer from integer without a cast [enabled by default]
2 0 F:\待改错误\2-4.c In file included from F:\待改错误\2-4.c
53 15 e:\dev-cpp\mingw64\x86_64-w64-mingw32\include\string.h [Note] expected 'const char *' but argument is of type 'char'
10 4 F:\待改错误\2-4.c [Warning] passing argument 2 of 'strcmp' makes pointer from integer without a cast [enabled by default]
2 0 F:\待改错误\2-4.c In file included from F:\待改错误\2-4.c
53 15 e:\dev-cpp\mingw64\x86_64-w64-mingw32\include\string.h [Note] expected 'const char *' but argument is of type 'char'
12 16 F:\待改错误\2-4.c [Warning] initialization makes pointer from integer without a cast [enabled by default]
14 9 F:\待改错误\2-4.c [Warning] assignment makes integer from pointer without a cast [enabled by default]
C:\Users\Asus\AppData\Local\Temp\ccCsmuYe.o 2-4.c:(.text+0x11b): undefined reference to `xuan_ze'
F:\待改错误\collect2.exe [Error] ld returned 1 exit status

img

#include<stdio.h>
#include<string.h>
void xuan_ze(char a[],int n)
{
    int i,j;
    for(i=0;i<n-1;i++)
    {
        for(j=0;j<n-1-i;j++)
        {
            if(a[j]<a[j+1])
            {
                char m=a[j];
                a[j]=a[j+1];
                a[j+1]=m;
            }
        }
    }
}
int main()
{
    char a[10];
    int j;
    for(j=0;j<10;j++)
    scanf("%c",&a[j]);
    xuan_ze(a,10);
    for(j=0;j<10;j++)
    {
        printf("%c ",a[j]);
    }
    return 0;
}