View Code of Problem 50

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

Double click to view unformatted code.


Back to problem 50