View Code of Problem 50

#include<stdio.h>
#include<string.h>
int main()
{
	char str1[80];
	int i,n,flag;
	flag=0;
	gets(str1); 
	for(i=0;i<strlen(str1);i++)
	{
		if((str1[i]>='0'&&str1[i]<='9')==0)
		{
			str1[i]='*';
		}
		
	}
	for(i=0;i<strlen(str1);i++)
	{
		if(str1[i]!='*')
		{
			printf("%d",str1[i]);
		}
		else
		{
			if(str1[i+1]!='*')
			  printf("%c",str1[i]);
		}
	 } 
	 return 0;
}

Double click to view unformatted code.


Back to problem 50