#include
#include<string.h>
using namespace std;
int myAtoiRecursive(string *str, int n)
{
// Base case (Only one digit)
if (n == 1)
return *str - ‘0’;
// If more than 1 digits, recur for (n-1), multiplu result with 10
// and add last digit
return (10 * myAtoiRecursive(str, n - 1) + str[n-1] - '0');
}
// Driver Program
int main(void)
{
#include
#include<string.h>
using namespace std;
int myAtoiRecursive(char *str, int n)
{
// Base case (Only one digit)
if (n == 1)
return *str - ‘0’;
// If more than 1 digits, recur for (n-1), multiplu result with 10
// and add last digit
return (10 * myAtoiRecursive(str, n - 1) + str[n-1] - '0');
}
// Driver Program
int main(void)
{ int n;
cin>>n;
string str[n] ;
for(int i=0;i<n;i++)
{
getlin(cin,str);
}
cout<<myAtoiRecursive(str, n);
return 0; }
this is my code