# include<stdio.h> # include<string.h> int main(void) { char a[80],b[80]; int i = 0,j,t,m; gets(a); t = strlen(a); for(j=0;j<t;++j) { if(a[i]>=0&&a[i]<=9) { b[j] = a[i]; ++i; } else if((a[i]<0||a[i]>9)&&(a[i+1]>=0||a[i+1]<=9)) { ++i; --t; m = i; while(a[m]>=0&&a[m]<=9) { b[j] = '*'; break; } } } for(j=0;j<i;++j) { printf("%c",b[j]); } return 0; } |
Double click to view unformatted code.