面向对象上机题-迭归算法
生活随笔
收集整理的這篇文章主要介紹了
面向对象上机题-迭归算法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//面向對象上機題 二
//迭歸算法
//Date:2005/10/27
//Make By:張建波
#include "iostream.h"
#include "string.h"
void fs(char *s,int n=0)
{
?int L=strlen(s);
?if(n!=L)
?{?n++;
??cout<<s[L-n];
??? ?fs(s,n);
?}?
}
void main()
{
?char *s="abcdefgh";
?cout<<"/n原字符串為:"<<s<<endl;
?cout<<"逆序輸出的字符串為:";
?fs(s);
?cout<<endl;
}
轉載于:https://www.cnblogs.com/hgndinfo/archive/2006/02/09/2713922.html
總結
以上是生活随笔為你收集整理的面向对象上机题-迭归算法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jrebel、JavaRebel
- 下一篇: “javax.servlet.http.