View Code of Problem 50

#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main()
{
    int i,j = 0,k = 1;
    char c[100],d[100];
    gets(c);
    for(i = 0;i < strlen(c);i++)
    {
        if(isdigit(c[i]))
        {
            d[j++] = c[i];
            k = 1;
        }
        else
        {
            if(k == 1)
            {
                d[j++] = '*';
                k = 0;
            }
        }
    }
    d[j] = '\0';
    puts(d);
}

Double click to view unformatted code.


Back to problem 50