View Code of Problem 50

#include<stdio.h>
#include<string.h>
int main()
{
	char a[80],b[80];
	gets(a);
	int count=0,i=0,j=0; 
	printf("%s",a);
	while(a[i]!='\0'){
		if(a[i]>='0'&&a[i]<='9')
		{
			b[j]=a[i];
			j++;i++;
			count=0;
		}
		else {
			if(count==0)
			{
				b[j]='*';
				j++;i++;count++;
				
			}
			else i++;
		}
	}
	b[j]='\0';
	for(int k=0;k<j;k++){
		printf("%c",b[k]);
	}
	
}
 

Double click to view unformatted code.


Back to problem 50