//This program will convert a number string into a number of digits
#include<iostream>
#include "stdio.h"
using namespace std;
int ATOI(char *str)
{
int n=0;
while(*str)
{
n = n*10 + (*str - '0');
++str;
}
return n;
}
int main()
{
char buffer[200];
cout<<"Enter a number of any digit: ";
cin>>buffer;
printf("%d", ATOI(buffer));
return 0;
}