#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[1005];
int main(){
int t;
int len;
int i,j;
scanf("%d",&t);
getchar();
while(t--){
gets(a);
len=strlen(a);
printf("%c",a[0]);
for(i=1;i<len;i++){
if(a[i]=='-'&&a[i-1]<=a[i+1]&&((a[i-1]>='a'&&a[i-1]<='z'&&a[i+1]>='a'&&a[i+1]<='z')||(a[i-1]>='A'&&a[i-1]<='Z'&&a[i+1]>='A'&&a[i+1]<='Z')||(a[i-1]>='0'&&a[i-1]<='9'&&a[i+1]>='0'&&a[i+1]<='9'))){
for(j=a[i-1]+1;j<=a[i+1]-1;j++)
printf("%c",j);
}
else
printf("%c",a[i]);
}
printf("\n");
}
return 0;
}
/**************************************
Problem id : SDUT OJ 1916
Result : Accepted
Take Memory : 452K
Take Time : 0MS
Submit Time : 2013-05-26 17:44:53
**************************************/
sdut1916 字符串扩展
最新推荐文章于 2022-06-19 22:34:09 发布