View Code of Problem 50

#include<iostream> 
#include <stdio.h>
#include <math.h>
#include "string.h"
using namespace std;
int main(){
	char a[81];
	gets(a);
	int flag=1;
	int n=strlen(a);
	for(int i=0;i<n;i++){
		 if(a[i]>=48&&a[i]<=57){
		 	cout<<a[i];
		 	flag=1;
		 }else{
		 	if(flag==1)
		 	cout<<"*";
		 	flag=0;
		 }
	}
	return 10;
}

Double click to view unformatted code.


Back to problem 50