
算法
文章平均质量分 64
慧星猿
这个作者很懒,什么都没留下…
展开
-
二分法查找
//功能:查询某关键在此buf序列中是否存在,如果存在返回其下标,否则返回-1#includeshort find(int key,int* buf,int ilen);int find1(int buf[],int key,int left,int right);void main(){int buf[]={1,2,3,4,5,6,8,9,10,11,12,1原创 2017-08-02 21:11:14 · 328 阅读 · 0 评论 -
C语言-昨天时间明细
1、日历的方式#include<stdio.h>#include <time.h>struct{ int y; int m; int d; }jintian; int m[]={31,28,31,30,31,30,31,31,30,31,30,31};int main(){ time_t st_now; struc...原创 2018-05-09 18:41:37 · 442 阅读 · 0 评论 -
C语言 strstr匹配分割字符串
//原型:extern char *strstr(char *haystack, char *needle); //用法:#include <string.h> //功能:从字符串haystack中寻找needle第一次出现的位置(不比较结束符NULL)。 //说明:返回指向第一次出现needle位置的指针,如果没找到则返回NULL.//使用例:...原创 2018-05-18 15:50:32 · 3068 阅读 · 0 评论