View Code of Problem 50

#include <stdio.h>

int main()
{
	char a[1000],b[1000];
	int i,t=0;
	gets(a);
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]>='0' && a[i]<='9')
		{
			b[t]=a[i];
			putchar(b[t]);
			t++;
		}else
		{
			if(b[t-1] !='*' )
			{
				b[t]='*';
				putchar(b[t]);
				t++;
			}
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 50