View Code of Problem 50

#include<cstdio>
#include<string>
#include<iostream>
using namespace std;
int main(){
	string str;
	getline(cin,str);
	int len=str.length();
	if(str[0]<'0'||str[0]>'9')	printf("*");
	for(int i=0;i<len;i++){
		while(str[i]>='0'&&str[i]<='9'){
			printf("%c",str[i]);
			i++;
			if(((str[i]<'0'||str[i]>'9')&&i<len))	printf("*");
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 50