/*copyright (c) 2013,煙臺大學計算機學院
*All rights reserved.
*作者:趙振凱
*完成日期:2013年11月20日
*版本號:v1.0
*問題描述:基礎的遞歸數列
*/
#include <iostream>
using namespace std;
void f(int);
int main()
{
int i=1234;
f(i);
return 0;
}
void f(int n)
{
if(n==0)
return;
else
{
f(n/10);
cout<<n%10;
return;
}
}
運行結果: