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

网站什么做的精品网站建设

网站什么做的,精品网站建设,合肥市建设局,哪个网站用div做的好1.做题须知 这一题告诉我们可以尝试修改下面的输出,在觉得OK之后删除// I AM NOT DONE注释即可进入下一题 // intro1.rs // About this I AM NOT DONE thing: // We sometimes encourage you to keep trying things on a given exercise, even // after you already figured …1.做题须知 这一题告诉我们可以尝试修改下面的输出,在觉得OK之后删除// I AM NOT DONE注释即可进入下一题 // intro1.rs // About this I AM NOT DONE thing: // We sometimes encourage you to keep trying things on a given exercise, even // after you already figured it out. If you got everything working and feel // ready for the next exercise, remove the I AM NOT DONE comment below. // Execute rustlings hint intro1 or use the hint watch subcommand for a hint. // // If youre running this using rustlings watch: The exercise file will be reloaded // when you change one of the lines below! Try adding a println! line, or try changing // what it outputs in your terminal. Try removing a semicolon and see what happens!// I AM NOT DONEfn main() {println!(Hello and);println!(r# welcome to... #);println!(r# _ _ _ #);println!(r# _ __ _ _ ___| |_| (_)_ __ __ _ ___ #);println!(r# | __| | | / __| __| | | _ \ / _ / __| #);println!(r# | | | |_| \__ \ |_| | | | | | (_| \__ \ #);println!(r# |_| \__,_|___/\__|_|_|_| |_|\__, |___/ #);println!(r# |___/ #);println!();println!(This exercise compiles successfully. The remaining exercises contain a compiler);println!(or logic error. The central concept behind Rustlings is to fix these errors and);println!(solve the exercises. Good luck!);println!();println!(The source for this exercise is in exercises/intro/intro1.rs. Have a look!);println!(Going forward, the source of the exercises will always be in the success/failure output.); }2.基本输出 我们使用{:?}通配输出一下就好了 // intro2.rs // Make the code print a greeting to the world. // Execute rustlings hint intro2 or use the hint watch subcommand for a hint.fn main() {println!(Hello {:?}!,world); }3.变量绑定 由于Rust里面的变量完全属于主人,所以我们需要使用let语句来对变量进行绑定 // variables1.rs // Make me compile! // Execute rustlings hint variables1 or use the hint watch subcommand for a hint.fn main() {let x 5;println!(x has the value {}, x); }4.变量类型 这一题告诉我们变量需要类型,给类型只需要我们对其赋值即可,rust会自动分配他的类型 // variables2.rs // Execute rustlings hint variables2 or use the hint watch subcommand for a hint.fn main() {let x3;if x 10 {println!(x is ten!);} else {println!(x is not ten!);} }5.指定变量类型 我们需要对变量初始化赋值才能使用,而且可以使用:i32指定变量为32位整数 // variables3.rs // Execute rustlings hint variables3 or use the hint watch subcommand for a hint.fn main() {let x: i323;println!(Number {}, x); }6.创建可变类型变量 不设置变量为可变类型,就会在改变时报错 // variables4.rs // Execute rustlings hint variables4 or use the hint watch subcommand for a hint.fn main() {let mut x 3;println!(Number {}, x);x 5; // dont change this lineprintln!(Number {}, x); }7.重新绑定(变量遮蔽) 当需要用一个变量读取不同类型的数据的时候 可以使用let数据类型重新创建一个 // variables5.rs // Execute rustlings hint variables5 or use the hint watch subcommand for a hint.fn main() {let mut number T-H-R-E-E; // dont change this lineprintln!(Spell a Number : {}, number);let number:i32 3; // dont rename this variableprintln!(Number plus two is : {:?}, number ); }8.常量申明 常量不仅仅默认不可变而且自始至终不可变因为常量在编译完成后已经确定它的值。 常量使用 const 关键字而不是 let 关键字来声明并且值的类型必须标注 // variables6.rs // Execute rustlings hint variables6 or use the hint watch subcommand for a hint.const NUMBER:i32 3; fn main() {println!(Number {}, NUMBER); }9.书写函数 使用fn funName(){}来创建一个函数申明,然后在main函数里面调用 // functions1.rs // Execute rustlings hint functions1 or use the hint watch subcommand for a hint.fn call_me(){println!(Hello Rust); } fn main() {call_me(); }10.函数传入形参需要指定类型 形参需要申明传入的变量的类型 // functions2.rs // Execute rustlings hint functions2 or use the hint watch subcommand for a hint.fn main() {call_me(3); }fn call_me(num:i32) {for i in 0..num {println!(Ring! Call number {}, i 1);} }
http://www.hkea.cn/news/14375190/

相关文章:

  • dedecms导航网站电子商务公司网站怎么建
  • 南宁网站推广流程公司关键词排名优化
  • 安徽黄山网站建设小程序搭建系统
  • 网站在哪里变更备案信息网络公司什么意思
  • 网站建设的视频教程wordpress+调用多媒体
  • 贵州网站建设设计南昌做企业网站
  • 怎么做网站上打字体宁波外贸公司电话名单
  • 网站建设推进情况哈尔滨怎样快速建站
  • 微信的网站怎么做洛阳青峰网络公司做网站
  • 网站开发财务费用网站 wap
  • 国内卡一卡二卡三网站视频在线支付的网站怎么做
  • 徐州做网站的公司有几家工作细胞第一季
  • 有没有网站做胡兼职上海最好网站建设公司
  • 网站seo优化查询怎么看网站的建站公司是哪个
  • 高端网站设计公司广告策划方案
  • 新公司网站怎么做推广东营网站建设那家好
  • 有哪些做软件的网站传奇新服网
  • 网站做什么推广好类似头条的网站怎么做
  • 自己做网站导航页wordpress导航怎么添加连接
  • 网站架构的组成部分智慧团建登录网站入口
  • 中型网站每天访问量seo的优化方案
  • 网站页面相关产品链接怎么做网站策划的基本过程
  • 佛山学校网站建设中信建设有限责任公司中标公示
  • 网站开发用啥语言他达拉非片说明书
  • 重庆丰标建设网站多语言企业网站建设
  • 白云网站建设价格上小学网站建设
  • Wix网站开发 工作室个人主页建站
  • 网站建设群网站logo尺寸一般多大
  • cod单页建站工具天津网络广告公司
  • 国外网站设计网页小游戏4933