字符串排序
来源:互联网 发布:包包设计软件 编辑:程序博客网 时间:2024/06/09 21:56
<span style="font-size:18px;">#include <stdio.h>#include <string.h>void swap(char **p1,char **p2){ char **tmp = p1;p1 = p2;p2 = tmp;}int main(){char *ch[3];int i = 0;ch[0] = "abcdefg";ch[1] = "abcd";ch[2] = "brtfs";if(strcmp(ch[0],ch[1])>0){swap(&ch[0],&ch[1]);}if(strcmp(ch[0],ch[2])>0){swap(&ch[0],&ch[2]);}if(strcmp(ch[1],ch[2])>0){swap(&ch[1],&ch[2]);}for(;i<3;i++){printf("%s\n",ch[i]);}return 0;}</span>
0 0
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序。
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 字符串排序
- 排序字符串
- curl 命令详解
- LINQ Contact/Union/Intersect/Skip/Except/pageing/Link操作
- VS2010+QT5编程之setWindowIcon报错解决方案
- qt之undefined reference to vtable for出现原因
- stm32f407建立工程模板
- 字符串排序
- 解决bug:运行项目时报异常 “Can't create handler inside thread that has not called Looper.prepare()”——诺诺"涂鸦"记忆
- UIActionSheet的最后一个按钮 不响应的问题
- 黑马程序员_Map集合中按value值进行排序
- 虚拟机上网问题
- SpringMVC注解控制器详解
- jenkins中记录Unity AssetServer的日志
- 内存使用准则
- HLS 基本知识及环境搭建