View Code of Problem 50

#include "stdio.h"
#include "math.h"
#include "string.h"

void main()
{
	int i,j,k;
	char s[100];
	char c[100];
	gets(s);
	for(i=0,j=0;s[i]!='\0';i++)
	{
		if(s[i]>='0'&&s[i]<='9')
		{
			c[j]=s[i];j++;
		}
		else if((s[i+1]>='0'&&s[i+1]<='9')||s[i+1]=='\0')
        {
            c[j]='*';j++;
        }
	}
	c[j]='\0';
	puts(c);
}

Double click to view unformatted code.


Back to problem 50