View Code of Problem 50

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int b,c,n,i,k=0;
	char str1[80];
	char str2[80];
	gets(str1);
	int len=strlen(str1);
	for(i=0;i<len;i++){
		if(str1[i]<'0'||str1[i]>'9'){
			str2[k]='*';
			k++;
			while(str1[i+1]<'0'||str1[i+1]>'9')
				i++;
		}
		else{
			str2[k]=str1[i];
			k++;
		}
	}
	for(i =0;i<k;i++)
		printf("%c",str2[i]);
	return 0;
}

Double click to view unformatted code.


Back to problem 50