Chinaunix首页 | 论坛 | 博客
  • 博客访问: 443186
  • 博文数量: 113
  • 博客积分: 446
  • 博客等级: 下士
  • 技术积分: 1229
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-09 16:01
个人简介

Let's go!!!!!

文章分类

全部博文(113)

文章存档

2019年(5)

2018年(4)

2017年(9)

2016年(5)

2015年(39)

2014年(6)

2013年(28)

2012年(17)

发布时间:2015-01-17 21:16:05

1.数组定义[chengmo@centos5 ~]$ a=(1 2 3 4 5)[chengmo@centos5 ~]$ echo $a1一对括号表示是数组,数组元素用“空格”符号分割开。2.数组读取与赋值得到长度:[chengmo@centos5 ~]$ echo ${#a[@]}5用${#数组名[@或*]} 可以得到数组长度读取:[chengmo@centos5 ~]$ echo ${a[2]} 3[chengmo@centos5 ~]$ ec.........【阅读全文】

阅读(587) | 评论(0) | 转发(0)

发布时间:2015-01-17 21:12:53

SHELL字符串处理技巧(${}、##、%%) ${#VALUE}:计算VALUE字符串的字符数量。${VALUE%.*}或${VALUE%%.*}:删除VALUE字符串中以分隔符“.”匹配的左边字符,保留右边字符。${VALUE#*.}或${VALUE##*.}:删除VALUE字符串中以分隔符“.”匹配的右边字符,保留左边字符。${VALUE/OLD/NEW}或${VALUE//OLD/NEW}:用NEW子.........【阅读全文】

阅读(659) | 评论(0) | 转发(0)

发布时间:2014-12-14 22:53:42

产生随机数:#include <stdlib.h>#include <string.h>#include <stdio.h>#include <time.h>#include "generate.h"void generate(int *data,int size){   int i = 0;   int j = 0;   int number = 0;   srand(time(NULL));       for(i = 0;i < .........【阅读全文】

阅读(1213) | 评论(0) | 转发(0)

发布时间:2014-12-14 21:16:32

产生随机数:#include <stdlib.h>#include <string.h>#include <stdio.h>#include <time.h>#include "generate.h"void generate(int *data,int size){   int i = 0;   int j = 0;   int number = 0;   srand(time(NULL));       for(i = 0;i < N.........【阅读全文】

阅读(930) | 评论(0) | 转发(0)

发布时间:2014-12-14 12:54:52

排序函数:#include <stdio.h>#include <malloc.h>#include <stdlib.h>#include <string.h>int ctsort(int *data,int size,int max){   int *count = NULL;   int *temp = NULL;   int i = 0;   int j = 0;   if((count = (int *)malloc(max * sizeof(int).........【阅读全文】

阅读(1039) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册