#include <stdio.h> #include <string.h> #include <math.h> #define N 100000 int main() { char a[N],b[N]; int i,j=0; gets(a); int lenth=strlen(a); for(i=0;i<lenth;i++) { if(a[i]>='0'&&a[i]<='9') b[j++]=a[i]; else if(b[j-1]!='*') b[j++]='*'; } b[j]='\0'; puts(b); return 0; } |
Double click to view unformatted code.