string int2str( int num)
{
if (num == 0 )
return " 0 " ;
string str = "" ;
int num_ = num > 0 ? num : - 1 * num;
while (num_)
{
str = ( char )(num_ % 10 + 48 ) + str;
num_ /= 10 ;
}
if (num < 0 )
str = " - " + str;
return str;
}
时间: 2024-11-12 21:50:27