View Code of Problem 50

#include<stdio.h>
#include<math.h>
#include<ctype.h>
#include<string.h>
#include<iostream>
using namespace std;
#include<algorithm>
int main()
{
	char str[100];
	char a[100];
	int flag = 0;
	gets(str);
	int count = 0;
	int len = strlen(str);
	for (int i = 0; i < len; i++)
	{

		if (isdigit(str[i])==0)
		{
			if (flag == 0)
			{
				a[count++] = '*';
				flag = 1;
			}
		}
		else
		{
			a[count++] = str[i];
			flag = 0;
		}
	
		
	}
	//count++;
	a[count] = '\0';
	puts(a);
}

Double click to view unformatted code.


Back to problem 50