#include<stdio.h>
#include<string.h>
void main()
{
int i,j=0,k=0,m=0;
char grade[100],temp1[300],temp2[100],temp3[100];
printf("请输入一个字符串:");
gets(grade);
for(i=0;grade[i]!='\0';i++)
{
if((grade[i]>=65 && grade[i]<=90) || (grade[i]>=97 && grade[i]<=122))
{
temp1[j]=grade[i];
j++;
}
else if(grade[i]>=48 && grade[i]<=57)
{
temp2[k]=grade[i];
k++;
}
else
{
temp3[m]=grade[i];
m++;
}
}
temp1[j]='\0';
temp2[k]='\0';
temp3[m]='\0';
strcat(temp1,temp2);
strcat(temp1,temp3);
printf("结果为:%s\n",temp1);
}