View Code of Problem 50

#include<bits/stdc++.h>
using namespace std;

char str[90];
int main()
{
	cin.getline(str,90);
	int len=strlen(str);
	int flag=0;
	for(int i=0;i<len;i++)
	{
		if(str[i]>='0'&&str[i]<='9') 
		{
				printf("%c",str[i]);
				flag=0;
		}
		
		else
		{
			if(flag==0)
			{
				printf("*");
				flag=1;
			}
			else ;
		}
	}
	
} 

Double click to view unformatted code.


Back to problem 50