View Code of Problem 50

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

Double click to view unformatted code.


Back to problem 50