#include <iostream>
using namespace std;

int xmax(int a[],int i)
{
int k,temp;
for (k = 0; k < n; k++)
{
index = k;
for (i = k + 1; i < n; i++)
{
if (a[i] > a[index])

index = i;
temp = a[index];
a[index] = a[k];
a[k] = temp;

}
}
}

int main()
{
int a[1000],i;
int x; cin>>x;
int xx=x;
while(xx!=0)
{
a[i++]=xx%10;//存入数组
xx=xx/10;
}
int max=xmax(a,i)
int min=xmin
}

0 条评论

目前还没有评论...