#include <stdio.h> #include <string.h> int main() { char str1[80]; char str2[80]; gets(str1); int i,flag=0,j=0; for(i=0; i<80; i++) { if(str1[i]=='\0') break; if(str1[i]<'0'||str1[i]>'9'){ if((str1[i+1]>='0'&&str1[i+1]<='9')||str1[i+1]=='\0'){ str2[j]='*'; j++; }else{ continue; } }else{ str2[j]=str1[i]; j++; } } str2[j]='\0'; puts(str2); return 0; } |
Double click to view unformatted code.