View Code of Problem 50

#include<stdio.h>
#include<math.h>
int main(){
 char str1[80],str2[100];
 int i,j=0,word=0;
 gets(str1);
  for(i=0;str1[i]!='\0';i++){
    if(str1[i]>='0'&&str1[i]<='9'){
    str2[j++]=str1[i];
      word=0;
    }
    else {
      if(word==0){
    str2[j++]='*';
      word=1;
    }
  }
 }
str2[j]='\0';
printf("%s",str2);
      return 0;
}

Double click to view unformatted code.


Back to problem 50