View Code of Problem 50

#include<string.h>
#include<stdio.h>
int main()
{
    char a[1001],b[1001]={0};
     int k=0,n,i,f=1;
     gets(a);
     n=strlen(a);
     for(i=0;i<n;i++)
     {
         if(a[i]>='0'&&a[i]<='9')
         {
             b[k++]=a[i];
         f=1;
         }
         else
            {
            if(f==1)
            {

                b[k++]='*';f=0;
            }
         }


     }
     puts(b);
     return 0;

}

Double click to view unformatted code.


Back to problem 50