用VC编写:
#include "iostream.h"
main(void)
{
int i,j;
int t[10];
cout<<"请输入10个数字:";
for(i=0;i<10;i++)
cin>>t[i];
for(i=0;i<9;i++)
{
k=t[i];
for(j=i+1;j<10;j++)
if(t[j]
}
for(i=10;i>=0;i--)
cout<
我给出的程序只能对数字进行排序,字母还要另外编写...没办法一个程序实现...
#include "stdio.h"
main()
{int i,j;
char a[10],t
for (i=0;i<10;i++)
{printf("请输入第%d个字符",i);
scanf("%c",&a[i]);}
for (i=0;i<10;i++)
for (j=0;j<10-i;j++)
if (a[j] {t=a[j+1];
a[j+1]=a[j];
a[j]=t;
}
for (i=1;i<10;i++)
printf("%c",a[i]);
}
dim i,j,k as integer;
dim a[10] as integer
for i=1 to 10
a[i]=i
next i
for i=0 to 9
for j=0 to i
if a[i]{
k=a[i];
a[i]=a[j];
a[j]=k;
}
next j
next i
dim i,j,k as integer;
dim a[10] as integer
for i=1 to 10
a[i]=i
next i
for i=0 to 9
for j=0 to i
if a[i] {
k=a[i];
a[i]=a[j];
a[j]=k;
}
next j
next i