#include<stdio.h>
main()
{
char str[100];
int s[50];
int i=0,j=0,count=0,flag=0,t=0;
puts("请输入字符串:");
gets(str);
do //提取整数
{
if('0'<=str[i]&&str[i]<='9')
{
flag=1;
t=10*t+str[i]-'0';
}
else
{
if(flag==1)
{
count++;
s[j++]=t;
}
flag=0;
t=0;
}
i++;
}while(str[i-1]!='\0');
for(i=0;i<count;i++) //排序
{
for(j=i;j<count;j++)
if(s[i]>s[j])
{
t=s[i];
s[i]=s[j];
s[j]=t;
}
}
for(i=0;i<count;i++) //输出
{
printf("%d ",s[i]);
}
printf("\n");
}