摘要: 1 #include <iostream> 2 using namespace std; 3 4 typedef int elem; 5 6 struct Node{ 7 elem n; 8 struct Node * next; 9 }; 10 11 //创建 12 Node* Create_li 阅读全文
posted @ 2020-03-05 21:03 xuecl 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 题意: 比如,输入:I come from China. 输出:China. from come I 思路:先将这个字符串整体倒置,再将单个单词倒置,这样既不需要移动元素,也不需要额外的辅助空间,还可以重用代码,很不错吧。 代码: 1 #include <iostream> 2 3 int len( 阅读全文
posted @ 2020-03-05 20:11 xuecl 阅读(779) 评论(0) 推荐(0) 编辑