View Code of Problem 50

#include<stdio.h>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
int main(){
        char a[100];
        char b[100];
        gets(a);
        int i = 0;
        int j = 0;
        while(a[i] != '\0'){
        	if(a[i] >= '0' && a[i] <= '9')
        		b[j++] = a[i++];
        	else{
        		while(a[i] != '\0' && (a[i]<'0' || a[i] > '9'))
        			i++; 
        		b[j++]='*';
			}
		}
		b[j] = '\0';
		j = 0;
	puts(b);
	  return 0;
}

Double click to view unformatted code.


Back to problem 50