- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 C语言复习日记1:二分查找
/*binsearch函数:在v[0]<=v[1]<=v[2]<=...<=v[n-1]中查找x*/ int binsearch(int x,int v[],int n) { int low,high,mid; low=0; high=n-1; while(low<=high){ mid=(low+high)/2; if(x<v[mid]) high=mid-1; else if (x>v[mid]) low=mid+1; els
2021-04-08 15:21:52
85
原创 GO语言学习之类型断言
GO语言学习之类型断言 接口断言有两种方式,一种是ok-pattern,一种是switch-type。一般来说,当要断言的接口类型种类较少时,可以使用前者。 当要断言的接口类型种类较多时,使用前者很累赘,代码冗余。这时我们可以使用后者来进行批量判断。 //12.5类型断言 package main import "fmt" type Person interface { Speak() } type Student struct{ Name string Age int } func (s Stud
2021-01-12 15:14:05
227
原创 C语言程序设计(1)
1.hello, world Descrption 输出 hello, world 别忘了换行哦 _ Input 无 Output hello, world Hint http://zh.wikipedia.org/wiki/Hello_World http://en.wikipedia.org/wiki/"Hello,world!"program #include <stdio.h>...
2019-01-11 16:24:34
158
中山大学统计分析方法ch1
2019-02-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人