View Code of Problem 50

#include<stdio.h>
#include<string.h>
int main()
{
char str[1000],a[1000];
int i,t,j=0;
gets(str);
for(i=0;i<28;i++)
a[i]=0;
for(i=0;i<strlen(str);i++)
{
if(str[i]>='0'&&str[i]<='9')
a[j++]=str[i];
else
a[j++]='*';

}
for(i=0;i<j;i++)
{
if(a[i]>='0'&&a[i]<='9')
printf("%c",a[i]);
if(a[i]=='*'&&a[i+1]!='*')
printf("%c",a[i]);
}
return 0;
}

Double click to view unformatted code.


Back to problem 50