View Code of Problem 50

#include  <stdio.h>
#include  <stdlib.h>
#include  <math.h>
#include  <string.h>


int main()
{
	char s[1000];
	char str[100]={0};
	char *p,*q;
	char f;
	
	if(gets(s))
	{
		p=s;
		q=str;
		f=1;
		while (*p!='\0')
		{
			if(*p>='0'&&*p<='9')
			{
				*q=*p;
				q++;
				f=1;
			}
			else
			{
				if(f==1)
				{
					*q = '*';q++;
				}
				f=0;
			}
			p++;
		}
		puts(str);
	}

    return 0;
}

Double click to view unformatted code.


Back to problem 50