View Code of Problem 50

#include<stdio.h>
#include<string.h>
int main()
{
	int length,i,j=0,k=0;
	char a[80],b[80];
	gets(a);
	length=strlen(a);
	for(i=0;i<length;i++)
	{
		if(a[i]>='0'&&a[i]<='9')
		{
			b[j]=a[i];
			j++;
			k=0;
		}
		else
		{
			k++;
			if(k==1)
			{
				b[j]='*';
				j++;
			}
		}
	}
	b[j]=NULL;
	puts(b);
}

Double click to view unformatted code.


Back to problem 50