1.将包含字符数字的字符串分开,使得分开后的字符串前一部分是数字后一部分是字母。
例如“h1ell2o3” ->”123hello”
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
char c [100];
int i,j;
int len,count,temp;
while(fflush(stdin),gets(c)!=NULL){
len=strlen(c);
count=-1;
for(i=0;i<len;i++){
if(c[i]>='0'&&c[i]<='9'){
count++;
temp=c[i];
for(j=i;j>count;j--){
c[j]=c[j-1];
}
c[count]=temp;
}
}
puts(c);
}
system ("pause");
return 0;
}