文章
7
粉丝
309
获赞
5
访问
67.5k
#include<stdio.h>
#include<string.h>
char* move_string(char* s){
int n=strlen(s);
int id_num=0;
int id_oth=0;
char num_s[100]={100};
char oth_s[100]={100};
for(int i=0;i<=n-1;i++){
if(s[i]>='0'&&s[i]<='9')
num_s[id_num++]=s[i];
else oth_s[id_oth++]=s[i];
}
for(int i=0;i<=id_num-1;i++){
oth_s[id_oth++]=num_s[i];
}
oth_s[id_oth]='\0';
//printf("%s",oth_s);
char* s_re=oth_s;
//printf("%s\n",s_re);
return s_re;
}
int main(){
char s[100]={0};
scanf("%s",s);
char* s1=move_string(s);
printf("%s",s1);
return 0;
}
登录后发布评论
暂无评论,来抢沙发