View Code of Problem 50

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s1;
	int i,t=0;
	getline(cin,s1);
	for(i=0;i<s1.length();i++){
		if(s1[i]>='0'&&s1[i]<='9'){
			cout<<s1[i];
			t=1;
		}
		else if(t==1){
			cout<<'*';
			t=0;
		}
	}
	cout<<endl;
	return 0;
}

Double click to view unformatted code.


Back to problem 50