View Code of Problem 50

# include<stdio.h>
# include<string.h>
int main(void)
{
  char a[80],b[80];
  int i = 0,j,t;
  gets(a);
  t = strlen(a);
  for(j=0;j<t;++j)
  {
    if(a[i]>='0'&&a[i]<='9')
    {
      b[j] = a[i];
      ++i;
    }
    else //if((a[i]<'0'||a[i]>'9')&&(a[i+1]>='0'||a[i+1]<='9'))
    {
		do
		{
          ++i;
	      --t;
		}while(a[i+1]>='0'&&a[i+1]<='9');
		 b[j] = '*';
    }
  }
 for(j=0;j<t;++j)
 {
 printf("%c",b[j]);
 }
  return 0;
}

Double click to view unformatted code.


Back to problem 50