the code is smth like that:
input is 0..9 & a..b (not checks others)
counts the base of the 'number' (max 36 - 'z'), and writes down that 'number' is in decimal
Code:
#include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
char s[256];
int base=0,basemax=0,i;
long decimalone=0;
scanf("%s",&s);
for (i=0;i<strlen(s);i++)
{
if (s[i]>=97)
base=s[i]-86;
else
base=s[i]-47;
if (base>basemax)
basemax=base;
}
for (i=0;i<strlen(s);i++)
{ if (s[i]>=97)
decimalone+=(s[i]-87)*pow(basemax,(strlen(s)-1-i));
else decimalone+=(s[i]-48)*pow(basemax,(strlen(s)-1-i));
}
printf("\n\n%d",basemax);
printf("\n\n%d",decimalone);
return 0;
}