字符串逆转--递归

来源:互联网 发布:系统重装软件排行 编辑:程序博客网 时间:2024/04/27 13:35
 
 递归实现字符串逆转#include <iostream>using std::cin;using std::cout;void reverse(){ char ch; cin.get(ch); if(ch != '\n') { reverse(); cout.put(ch); }}int main(){ reverse(); return 0;}