View Code of Problem 50

#include<stdio.h>
#include<math.h>
int main()
{
	
	char str[80],str2[80];
	int i,j;
	gets(str);
	for(i=0,j=0;str[i]!='\0';i++)
	{
		if(str[i]>='0'&&str[i]<='9')
		{
			str2[j++]=str[i];
		}
		if(str[i]<'0'||str[i]>'9')
		{
			if(str[i+1]>='0'&&str[i+1]<='9'||str[i+1]=='\0')
			str2[j++]='*';
		}
	}
	puts(str2);
} 

Double click to view unformatted code.


Back to problem 50