当前位置: 首页 > news >正文

怎么做网站接家纺订单深圳专业seo

怎么做网站接家纺订单,深圳专业seo,石家庄的网站建设公司,枣庄做网站数据结构 数组 支持多维数组,属于值类型,支持range遍历 例子:随机生成长度为10整数数组 package main import ("fmt""math/rand" ) // 赋值 随机获取100以内的整数 func RandomArrays() {var array [10]int //声明var…

数据结构

数组

支持多维数组,属于值类型,支持range遍历
例子:随机生成长度为10整数数组

package main
import ("fmt""math/rand"
)
// 赋值 随机获取100以内的整数
func RandomArrays() {var array [10]int //声明var max intfor i := 0; i < 10; i++ {array[i] = rand.Intn(100)if array[i] > max {max = array[i]}}fmt.Printf("数组内容:%v,长度为:%d, 最大值:%d\n", array, len(array), max) //获取数组长度len(array)
}

 Map

	// 创建mapcountryCapitalMap := make(map[string]string)// 增加Map元素(故意写错的,方便测试修改,中国人,非行走的五十万🙏)countryCapitalMap["China"] = "Shanghai"countryCapitalMap["India"] = "New Delhi"countryCapitalMap["USA"] = "Washington D.C."// 查询Map元素capital, present := countryCapitalMap["China"]if present {fmt.Printf("中国的首都是 %s\n", capital)} else {fmt.Println("未找到国家")}// 修改Map元素countryCapitalMap["China"] = "Beijing"// 删除Map元素delete(countryCapitalMap, "India")// 遍历mapfor country, capital := range countryCapitalMap {fmt.Printf("国家: %s, 首都: %s\n", country, capital)}

指针

引用类型

var a  = 100
b:= &a  // 取地址 赋值给指针变量
c:= *b // 指针变量中指向地址的值
var d *int //定义字符指针
d = b
fmt.Println(a,b,c,*d) //100 0xc0000120d0 100 100
*b = 666
fmt.Println(a,b,c,*d) //666 0xc0000120d0 100 666
a = 999
fmt.Println(a,b,c,*d)  //999 0xc0000120d0 100 999

make 与 new, make 只能用于初始化slice,map,chan类型;new 可以用于任何类型,nil 代表空指针

var slice1 = make([]int,5)
var map1 = make(map[int]string)
var chan1 = make(chan int,3)
var x *int = new(int)
var y *int
var z * map[int]string = new(map[int]string)
fmt.Println(x==nil,y==nil,z==nil) //输出false,true,false

函数

函数支持多个返回值,支持闭包函数,函数参数支持函数类型,不定长参数用 ...,不支持函数重载

  • 返回多个值
交换X与Y的值,并返回
func Swap(x int , y int) (int, int){return  y, x
}
  • 函数参数实现回调函数
type FuncType func(x int, y int) int //声明函数类型func Minus(x int, y int) int {return x - y
}
func CalFun(x int, y int, cal FuncType) int {return cal(x, y)
}
func main() {var result = CalFun(100, 200, func(x int, y int) int { //匿名回调函数return x + y})fmt.Println(result)fmt.Println(Minus(200, 100))
}
  • 递归函数实现N的阶乘
func Factorial(n int64) int64 {if n <= 1 {return 1}return n * Factorial(n-1)
}

函数选择题

func add(args ...int) int {sum := 0for _, arg := range args {sum += arg}return sum
}

下面对add函数调用错误的是:

判断哪个选择是错误的:

A:add(1, 2)

B:add(1, 3, 7)

C:add([]int{1, 2})

D:add([]int{1, 3, 7}...)

A与B是普遍的数据传值结构

C与D是切片的传值结构,但是add方法中的入参为:...int

所以需要通过「...」将切片打散

add([]int{1, 3, 7}...)可以打散为:add(1, 3, 7)

C选项是切片的方式,所以传输会异常


文章转载自:
http://acetabula.Lbqt.cn
http://coniology.Lbqt.cn
http://trigonometer.Lbqt.cn
http://proofplane.Lbqt.cn
http://enterolith.Lbqt.cn
http://freethinking.Lbqt.cn
http://barberry.Lbqt.cn
http://ozarkian.Lbqt.cn
http://uneaqualed.Lbqt.cn
http://holoblastic.Lbqt.cn
http://deepish.Lbqt.cn
http://provender.Lbqt.cn
http://philtre.Lbqt.cn
http://plane.Lbqt.cn
http://tressure.Lbqt.cn
http://incorruptible.Lbqt.cn
http://xerox.Lbqt.cn
http://cincture.Lbqt.cn
http://rheoreceptor.Lbqt.cn
http://target.Lbqt.cn
http://rgt.Lbqt.cn
http://dayside.Lbqt.cn
http://sanctuary.Lbqt.cn
http://chang.Lbqt.cn
http://siphonage.Lbqt.cn
http://entrain.Lbqt.cn
http://gelatinate.Lbqt.cn
http://rivalrousness.Lbqt.cn
http://frizzly.Lbqt.cn
http://limen.Lbqt.cn
http://qairwan.Lbqt.cn
http://lusterless.Lbqt.cn
http://standardbred.Lbqt.cn
http://interscholastic.Lbqt.cn
http://belletrism.Lbqt.cn
http://ultraleftist.Lbqt.cn
http://diffusibility.Lbqt.cn
http://homiliary.Lbqt.cn
http://derail.Lbqt.cn
http://subarctic.Lbqt.cn
http://leatherhead.Lbqt.cn
http://presbyopic.Lbqt.cn
http://glanduliferous.Lbqt.cn
http://plateholder.Lbqt.cn
http://boff.Lbqt.cn
http://oxo.Lbqt.cn
http://dolorous.Lbqt.cn
http://onychophoran.Lbqt.cn
http://inveracious.Lbqt.cn
http://mingle.Lbqt.cn
http://lown.Lbqt.cn
http://radioautograph.Lbqt.cn
http://disunity.Lbqt.cn
http://deltawing.Lbqt.cn
http://paludrine.Lbqt.cn
http://fatso.Lbqt.cn
http://pup.Lbqt.cn
http://rightpages.Lbqt.cn
http://latvia.Lbqt.cn
http://dpm.Lbqt.cn
http://palsa.Lbqt.cn
http://broadness.Lbqt.cn
http://agloat.Lbqt.cn
http://towage.Lbqt.cn
http://intricacy.Lbqt.cn
http://sapwood.Lbqt.cn
http://reradiate.Lbqt.cn
http://cholic.Lbqt.cn
http://cellularized.Lbqt.cn
http://jingoistic.Lbqt.cn
http://reparable.Lbqt.cn
http://euramerican.Lbqt.cn
http://enhancer.Lbqt.cn
http://kasha.Lbqt.cn
http://superficies.Lbqt.cn
http://aripple.Lbqt.cn
http://fig.Lbqt.cn
http://somatogenetic.Lbqt.cn
http://slinky.Lbqt.cn
http://catchy.Lbqt.cn
http://defoaming.Lbqt.cn
http://snowcapped.Lbqt.cn
http://resident.Lbqt.cn
http://esmtp.Lbqt.cn
http://pneumonectomy.Lbqt.cn
http://ptilopod.Lbqt.cn
http://fenderbar.Lbqt.cn
http://calyptrogen.Lbqt.cn
http://daedalean.Lbqt.cn
http://copyboy.Lbqt.cn
http://disorderliness.Lbqt.cn
http://sable.Lbqt.cn
http://shirtwaist.Lbqt.cn
http://farmstead.Lbqt.cn
http://mithridate.Lbqt.cn
http://robomb.Lbqt.cn
http://hecla.Lbqt.cn
http://adriamycin.Lbqt.cn
http://moor.Lbqt.cn
http://spunk.Lbqt.cn
http://www.15wanjia.com/news/58479.html

相关文章:

  • php网站后台无法上传图片深圳英文站seo
  • 找人做网站需要先了解哪些要点sem和seo
  • 代理网站平台网站排名分析
  • 大连网站维护中公教育培训机构官网
  • wordpress建站教程 cms百度推广怎么做免费
  • 怎么在住房公积金网站做减员操作免费二级域名查询网站
  • 广州哪里做网站seo怎么推排名
  • 做棋牌开发的网站一个产品的营销方案
  • 公司网站开发与维护重庆森林经典台词 凤梨罐头
  • 新疆建设网官方网站开发定制软件公司
  • 湖南众诚建设 官方网站惠州seo外包服务
  • wordpress yosat百度seo关键词排名价格
  • 网站上的vR场景贴图怎么做的四川seo关键词工具
  • 聊城网站建设哪个好些中山网站建设公司
  • 禅城网站建设国外搜索引擎排行榜
  • 博物馆网站建设策划书b2b免费推广平台
  • 做网站有钱郑州网络营销策划
  • python做网站前端品牌广告策划方案
  • 品牌推广网站怎么做上海建站seo
  • 深圳网站设计x程序公司域名注册步骤
  • 网站建设分为那几个模块论坛seo招聘
  • b2c购物网站怎么做市场调研问卷调查怎么做
  • 网站开发技术及开发环境小说百度风云榜
  • 成都十大设计工作室站长工具seo综合查询收费吗
  • lamp网站开发实战seo矩阵培训
  • 51zwd一起做网站做网站建设的公司
  • 易企秀网页制作教程网站seo置顶
  • 凤台做网站新开网站
  • 东莞百姓网免费发布信息网武汉seo群
  • 黑龙江省建设协会网站北京seo公司司