c++递归算法 整形数字 转换 字符串

题目:用递归法将一个整数 n 转换成字符串,例如:输入483,应输出字符串"483"。n的位数是不确定的。
问题:输出后开头多出来一个 0 ,why?

#include
#include
using namespace std;

void constest(int s)
{
    int t;
    char a;
    if (s != 0)
        constest(s / 10);
    t = s % 10;
    a = t + '0';
    cout << a;
}

int main()
{
    int s;
    cout << "输入整数: ";
    cin >> s;
    constest(s);
}


递归条件改一下

if (s/10!= 0)
        constest(s / 10);

代码有点啰嗦

using namespace std;
void constest(int s)
{
    if(s==0)
        return;
    constest(s / 10);
    cout<<(char)(s%10 + '0');
}
int main()
{
    int s;
    cout << "输入整数: ";
    cin >> s;
    constest(s);
}