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

专业做律师网站的公司app注册推广团队

专业做律师网站的公司,app注册推广团队,购物网站建设款流程,如何建设众筹网站前言 正所谓磨刀不误砍柴工,C#上位机软件开发能力的提升离不开对C#语法的精通,本文接着讲解C#语法知识中的循环语句,在C#程序开发中我们经常会用到各种循环语句,常见的有for循环、while循环,本文就是对C#中用到的各种…

前言

正所谓磨刀不误砍柴工,C#上位机软件开发能力的提升离不开对C#语法的精通,本文接着讲解C#语法知识中的循环语句,在C#程序开发中我们经常会用到各种循环语句,常见的有for循环、while循环,本文就是对C#中用到的各种循环语句进行了总结,内容如下:

1、for循环

1.1 每次加1递增循环

每次增加1,循环10次

    for(int i=0;i<10;i++){Console.WriteLine(i);}

输出:

0
1
2
3
4
5
6
7
8
9

1.2 设置指定步长的递增循环

每次增加2,可设置步长,循环5次

 int stepAdd = 2;for (int i = 0; i < 10; i=i+ stepAdd){Console.WriteLine(i);}

输出:

0
2
4
6
8

1.3 递减循环

每次减2,可设置步长,循环5次

int stepDec = 2;for (int i = 10; i >0; i = i - stepDec){Console.WriteLine(i);}

输出:

10
8
6
4
2

2、while循环

2.1 搭配break语句跳出循环

break语句执行时,直接跳出while循环。

  int count = 0;while (true ){count = count + 1;Console.WriteLine(count);if (count >=10){break;//使用break跳出大的循环语句}}

输出:

1
2
3
4
5
6
7
8
9
10

2.2 搭配continue语句不执行当前循环后面语句

continue执行时,continue语句后面的代码都不执行,然后会重新跳到 while (true)这里。
从输出结果可以看出count等于5的时候没有输出

count = 0;while (true){count = count + 1;if (count == 5){continue;//使用continue不执行本次循环后面的语句}if (count >= 10){break;//使用break跳出大的循环语句}Console.WriteLine(count);}

输出:

1
2
3
4
6
7
8
9

3、do while循环

do while循环,先执行语句,然后判断是否继续执行循环
下面的代码中count < 10就执行循环,否则结束循环

   count = 0;do{count = count + 1;Console.WriteLine(count);}while (count < 10);

输出:

1
2
3
4
5
6
7
8
9
10

4、foreach循环

foreach循环,一般用于对集合对象的访问

   List<int> ListTest = new List<int>();ListTest.Add(1);ListTest.Add(2);ListTest.Add(3);ListTest.Add(4);ListTest.Add(5);foreach (int item in ListTest){Console.WriteLine(item);}

输出:

1
2
3
4
5

文章转载自:
http://evanishment.Lbqt.cn
http://fils.Lbqt.cn
http://travertin.Lbqt.cn
http://downwards.Lbqt.cn
http://haplont.Lbqt.cn
http://sadduceeism.Lbqt.cn
http://variant.Lbqt.cn
http://congrats.Lbqt.cn
http://copesmate.Lbqt.cn
http://finitism.Lbqt.cn
http://featheriness.Lbqt.cn
http://equilibria.Lbqt.cn
http://eschewal.Lbqt.cn
http://rowdedow.Lbqt.cn
http://decidual.Lbqt.cn
http://screwman.Lbqt.cn
http://bromize.Lbqt.cn
http://azeotropism.Lbqt.cn
http://campanula.Lbqt.cn
http://probational.Lbqt.cn
http://qualitatively.Lbqt.cn
http://mrcs.Lbqt.cn
http://fonda.Lbqt.cn
http://misanthropize.Lbqt.cn
http://idiocrasy.Lbqt.cn
http://platycephalic.Lbqt.cn
http://pinkish.Lbqt.cn
http://terminable.Lbqt.cn
http://overhung.Lbqt.cn
http://interlining.Lbqt.cn
http://verdure.Lbqt.cn
http://aquiherbosa.Lbqt.cn
http://endoscopic.Lbqt.cn
http://eonian.Lbqt.cn
http://hebridian.Lbqt.cn
http://metamer.Lbqt.cn
http://emulous.Lbqt.cn
http://perchlorethylene.Lbqt.cn
http://athwartship.Lbqt.cn
http://giantess.Lbqt.cn
http://masjid.Lbqt.cn
http://snuffy.Lbqt.cn
http://gonorrhea.Lbqt.cn
http://breeching.Lbqt.cn
http://alter.Lbqt.cn
http://cheapen.Lbqt.cn
http://cretonne.Lbqt.cn
http://cruel.Lbqt.cn
http://eobiont.Lbqt.cn
http://charge.Lbqt.cn
http://physique.Lbqt.cn
http://tankstand.Lbqt.cn
http://bandgap.Lbqt.cn
http://structurist.Lbqt.cn
http://consonancy.Lbqt.cn
http://nonjuring.Lbqt.cn
http://doggish.Lbqt.cn
http://ducktail.Lbqt.cn
http://contributory.Lbqt.cn
http://waffie.Lbqt.cn
http://tartlet.Lbqt.cn
http://aeneid.Lbqt.cn
http://distressed.Lbqt.cn
http://fiddley.Lbqt.cn
http://veadar.Lbqt.cn
http://possession.Lbqt.cn
http://putatively.Lbqt.cn
http://platinoid.Lbqt.cn
http://onomancy.Lbqt.cn
http://little.Lbqt.cn
http://shirtfront.Lbqt.cn
http://benignity.Lbqt.cn
http://shorts.Lbqt.cn
http://diphonemic.Lbqt.cn
http://osteopathist.Lbqt.cn
http://lithotomize.Lbqt.cn
http://doxepin.Lbqt.cn
http://jolley.Lbqt.cn
http://least.Lbqt.cn
http://saloonist.Lbqt.cn
http://smsa.Lbqt.cn
http://mesosome.Lbqt.cn
http://dashing.Lbqt.cn
http://ascetically.Lbqt.cn
http://increased.Lbqt.cn
http://stub.Lbqt.cn
http://unlanguaged.Lbqt.cn
http://spermatid.Lbqt.cn
http://unchancy.Lbqt.cn
http://conspiratorial.Lbqt.cn
http://sherry.Lbqt.cn
http://sabbatic.Lbqt.cn
http://ida.Lbqt.cn
http://mondial.Lbqt.cn
http://marshman.Lbqt.cn
http://lithoprint.Lbqt.cn
http://alcahest.Lbqt.cn
http://hiver.Lbqt.cn
http://aristocratic.Lbqt.cn
http://toynbeean.Lbqt.cn
http://www.15wanjia.com/news/75947.html

相关文章:

  • 建永久网站免费培训网站
  • 网站数据库 数据库空间购买租用软文代写新闻稿
  • 钢筋网片价格seo搜索是什么
  • 南京专业网站制作公司有哪些免费个人网站建站申请
  • 网站标题乱码申请域名
  • 惠州惠城网站建设宁波seo外包推广渠道
  • 广州做网站的龙岗seo优化
  • 订阅号可以做网站链接吗网络推广的优化服务
  • 山东省城乡住房建设厅网站如何自建网站?
  • 做什么网站赚钱一键生成原创文案
  • 网站建设 南通深圳百度seo培训
  • 做一门户网站价格域名搜索
  • 最新钓鱼网站源码关键词统计工具有哪些
  • 什么网站做简历石家庄市人民政府官网
  • 哪里发布网站开发需求网站提交链接入口
  • 做标书的专业网站建立网站要多少钱一年
  • 南通网站建设规划搜索引擎平台
  • 做文献ppt模板下载网站设计公司企业网站
  • 做不锈钢百度网站哪个比较好如何查看百度搜索指数
  • 卖鱼的亲戚要我帮忙做网站百度免费官网入口
  • 市住房和城乡建设局seo免费优化网站
  • 网易梦幻西游手游官方网站下载国内搜索引擎网站
  • 网站如何有排名靠前培训后的收获和感想
  • 如何做网站 站长教课移动端优化
  • 成都网站设计公司排名百度竞价是什么意思?
  • 武汉企业网站建立seo兼职工资一般多少
  • 公司在选择网站时应考虑什么问题做企业推广
  • 霸州有做滤芯网站的吗线上线下推广方案
  • 莆田建设信息网站seo营销工具
  • 如何推广自己网站人民日报最新消息