View Code of Problem 50

#include<stdio.h>
#include <string.h>
#include <math.h>
int main(){
	char s[100];
	char a[100];
	int i,j=0;
	int flag=0;
	gets(s);
	int n=strlen(s);
	for(i=0;i<n;i++){
		if(s[i]>='0'&&s[i]<='9'){
			a[j++]=s[i];
			flag=0;
		}
		else{
			if(flag==0){
				a[j++]='*';
				flag=1;
			}
		}
	}
	a[j]='\0';
	puts(a);
	printf("\n");
	
	return 0;
}

Double click to view unformatted code.


Back to problem 50