View Code of Problem 50

#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	char str [100] ;
	gets(str );
	  int flag;
	int len=strlen(str );
	  int j=0;
	for(int i=0;i<len;i++)
	{
		if(str[i]>='0'&&str[i]<='9')
		  {
		      cout<<str[i];
		      flag=0;
		   } 
		   
		else if(flag==0){
			cout<<"*";
			flag=1;
		}
	}
	
	cout<<endl;
	 
}

Double click to view unformatted code.


Back to problem 50