atoi.c

 
#include
main()
{
char	in, flag = 0, accum = 0;
while ((in = getchar()) != EOF)
	{
	if (in >= 0x30 && in <= 0x39) 
	    {in -= 0x30; accum *= 10; accum += in; flag = 1;}
	else
	    {if (flag == 1)
		{putchar(accum); flag = 0; accum = 0;}
	    }
	}
if (flag == 1) putchar(accum);
}