17 lines
468 B
C++
17 lines
468 B
C++
//#include <iostream>
|
|
//using namespace std;
|
|
//
|
|
//void reverseInput() {
|
|
// char ch = getchar(); // 读取一个字符,包括空格和换行
|
|
// if (ch == '!') return; // 递归终止条件
|
|
// reverseInput(); // 先递归处理后续字符
|
|
// putchar(ch); // 然后输出当前字符,实现逆序
|
|
//}
|
|
//
|
|
//int main() {
|
|
// cout << "请输入以 ! 结尾的一串字符:" << endl;
|
|
// reverseInput(); // 调用递归函数
|
|
// cout << endl;
|
|
// return 0;
|
|
//}
|