View Code of Problem 50

#include<stdio.h>
#include<math.h>
int main(){
	char a[80];
	char b[80];
	gets(a);
	int i=0;
	int j;
	if(a[i]>='0'&&a[i]<='9'){
		b[j++]=a[i];
	}else{
		b[j++]='*';
	}
   int 	t=1;
	while(a[t]!='\0'){
		if(a[t]>='0'&&a[t]<='9'){
				b[j++]=a[t];
				t++;
					
		}else{//跳过非连续字符 <pre>$Ts!47&*s456  a23* +B9k</pre>
		//	while()
			if(b[j-1]!='*'){
				b[j++]='*';
			}
			t++;	
		}
	}
	puts(b);
	return 0;	
} 

Double click to view unformatted code.


Back to problem 50