ctci1.2
void reverse(char * str){
if(str == NULL)
return;
int len = strlen(str);
int i = ;
char tmp;
for(i = ; i < len/; i++){
tmp = *(str+i);
*(str+i) = *(str+len--i);
*(str+len--i) = tmp;
}
return;
}
ctci1.2的更多相关文章
- ctci1.8
bool isSub(string str0, string str1){ if(str0.length() != str1.length()) return false; ...
- ctci1.4
; ; ; i < len ; i++) ; +]; ; i < len; i++){ '; } ...
- ctci1.3
; i < len; i++){ if(str0[i] != str1[i]) return false; } return t ...
- ctci1.1
) ; ; i < len; i++){ if(place.find(str[i]) == place.end()) place. ...
随机推荐
- SDUT3165:Round Robina(循环链表)
题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=3165 题意分析: 比赛时这题没有A真伤心 ...
- PAT 1036 Boys vs Girls[简单]
1036 Boys vs Girls (25 分) This time you are asked to tell the difference between the lowest grade of ...
- beego——日志处理
这是一个用来处理日志的库,它的设计思路来自于 database/sql,目前支持的引擎有 file.console.net.smtp,可以通过如下方式进行安装: go get github.com/a ...
- python全栈开发从入门到放弃之递归函数的调用
1.递归效率低,需要在进入下一次递归时保留当前的状态,见51cto博客 解决方法是尾递归,即在函数的最后一步(而非最后一行)调用自动但是python又没有尾递归,且对递归层级做了限制 必须有一个明确的 ...
- 06 swap命令,进程管理,rmp命令与yum命令,源码安装python
作业一: 1)开启Linux系统前添加一块大小为15G的SCSI硬盘 2)开启系统,右击桌面,打开终端 3)为新加的硬盘分区,一个主分区大小为5G,剩余空间给扩展分区,在扩展分区上划分1个逻辑分区,大 ...
- Django:学习笔记(9)——用户身份认证
Django:学习笔记(9)——用户身份认证 User
- ruby 修改Setting config yaml内容
参考:http://ruby-doc.org/stdlib-1.9.3/libdoc/yaml/rdoc/YAML/Store.html 本事例只为说明如何修改yml文件内容. 一.需求是怎么样修改y ...
- hdu1403 Longest Common Substring
地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=1403 题目: Longest Common Substring Time Limit: 800 ...
- oracle修改某字段不是必输性
执行sql: ALTER TABLE table_name MODIFY 要修改的字段名字 NULL;
- ThinkPHP 调用后台方法
<a href="__URL__/del/id/{$vo['id']}">删除</a>