#include<stdio.h> #include<string.h> int main() { char str1[80]; char str2[80]; scanf("%s\n",str1); int i,j=0; for(i=0;i<strlen(str1);i++) { if((str1[i]>='0')&&(str1[i]<='9')) { str2[j++]=str1[i]; } else { if(str1[i+1]>='0'&&str1[i+1]<='9') { str2[j++]='*'; } if(i==strlen(str1)-1) { str2[j++]='*'; } } } printf("%s",str2); return 0; } |
Double click to view unformatted code.