View Code of Problem 50

#include <stdio.h>
#include <string.h>
int main(){
	char a[1000]={'\0'},b[1000]={'\0'};
	gets(a);
	int i=0,j=0,tag=0;
	for(;j<strlen(a);j++){
		if(a[j]>='0'&&a[j]<='9'){
			b[i++]=a[j];
			tag=0;
		}
		else{
			if(tag==0){
				b[i++]='*';
				tag=1;
			}
		}
	}
	puts(b);
}

Double click to view unformatted code.


Back to problem 50