View Code of Problem 50

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

Double click to view unformatted code.


Back to problem 50