View Code of Problem 50

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


int main()
{
	
	string s;
	getline(cin, s);
	int len = s.size(), flag = 1;
	for(int i = 0; i < len; i++)
	{
		if('0' <= s[i] && s[i] <= '9')
		{
			cout << s[i];
			flag = 1;
		 } 
		 else
		 {
		 	if(flag == 1)
			 {
			 	cout << '*';
			 	flag = 0;
			 }
		 }
		 
	}


	return 0;
}

Double click to view unformatted code.


Back to problem 50