View Code of Problem 50

#include <stdio.h>
#include <string.h>
int main(){
  char str1[100];
  char str2[100];
  gets(str1);
  int len;
  len=strlen(str1);
  int i,j=0;
  for(i=0;i<len;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==len-1)
        str2[j++]='*';
      
    }
  }
  str2[j]='\0';
  puts(str2);
  
  
  
  
  
  
  return 0;
}

Double click to view unformatted code.


Back to problem 50