#include<stdio.h> void fun(char str1[],char str2[]){ char *p; p=str1; int i=0; while(*p){ while(!(*p>='0'&&*p<='9')){ p++; } str2[i]='*'; i++; while(*p>='0'&&*p<='9'){ str2[i]=*p; i++; p++; } } } main(){ char str1[80]; char str2[80]; int i=0,j; for(j=0;str1[j]!='\0';j++){ scanf("%c",&str1[j]); } fun(str1,str2); for(i=0;str2[i]!='\0';i++){ printf("%c",str2[i]); } } |
Double click to view unformatted code.