View Code of Problem 50

#include<stdio.h>
#include<string.h>
int main() {
	char str1[80],str2[80];
	int i,count=0,k=0;
	gets(str1);
	for(i=0;i<strlen(str1);i++){
		if((str1[i]<'0'||str1[i]>'9')&&count==0){
			str2[k++]='*';
			count=1;
		}else if(str1[i]>='0'&&str1[i]<='9'){
			str2[k++]=str1[i];
			count=0;
		}
	}
	str2[k]='\0';
	 puts(str2);
	return 0;
}

Double click to view unformatted code.


Back to problem 50