View Code of Problem 50

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

Double click to view unformatted code.


Back to problem 50