您的位置:首页 > 其它

输入一个整数,使用递归方法实现反向输出

2013-10-30 14:52 549 查看
面试题:输入一个整数,使用递归方法实现反向输出

int RevOutInt(int iIntput)

{

 static unsigned int i = 0;

 static unsigned int j,k;

 k = iIntput%10;

 j = iIntput/10;

 i = 10*i+k;

  if(0==j)

  return i;

 RevOutInt(j);

}

此方法没有考虑算法的时间和空间复杂度。征求较优实现方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息