View Code of Problem 50

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char a[100];
	int num = 0;
	gets(a);
	for (int i = 0; i < strlen(a); i++) {
		if (a[i] >= '0'&&a[i] <= '9') {
			cout << a[i];
			num = 1;
		}
		else{
			if (num == 1) {
				cout << "*";
				num = 0;
			}
			else if (num == 0) {

			}
		}
	}
	cin >> a[0];
	return 0;
}

Double click to view unformatted code.


Back to problem 50