View Code of Problem 50

#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main() {
	string h;
	getline(cin,h);
	bool f=true;
	for(int i=0;i<h.length();i++)
	{
		if(!isdigit(h[i]))
		{
			if(f)
			{
			f=false;
			cout<<"*";	
			}
			
		}
		else
		{
			f=true;
			cout<<h[i];
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 50