View Code of Problem 50

#include <stdio.h>
#include <string.h>
int main()
{
	char a[1000];
	char str2[1000];
	int q;
	gets(a);
	int i;
	q = 0; 
while (a[i]!='\0')
	{
		if(a[i]>='0'&&a[i]<='9')
		{
		str2[q] = a[i];
		q = q + 1;		
		}
		else
		{
			while(a[i+1]<'0'||a[i+1]>'9')
			{
				
				i = i + 1;
			}
			
			str2[q] = '*';
			q = q + 1; 
		}
		
				i = i + 1;
	}
	puts(str2);
	
	return 0;
 } 

Double click to view unformatted code.


Back to problem 50