All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
使用ADO.net将数据导出到Excel并提供下载_[Asp.Net教程]
ASP.NET技巧:HTTP性能调优之设置连接失效时间_.net资料_编程技术
Apache服务器攻略,用户认证简单配置方案集_php资料_编程技术
怎样在Web开发中完美控制IE标题栏_[Asp.Net教程]
利用同义词简化SQL Server 2005开发_[SQL Server教程]
常见PHP页面漏洞分析及相关问题解决_php资料_编程技术
一个关于session使用的讨论_[Asp.Net教程]
Asp.Net下通过切换CSS换皮肤_[Asp.Net教程]
ajax+asp.net2.0,sql2005三级联下拉框_[Asp.Net教程]
AjaxPro与服务器端交互过程中如何传值_[AJAX教程]
Reading number is top 10 pictures
刘亦菲写真集2
遇到插队的怎么办?
性感丰满身材火爆de美女2
A man's favorite things15
两张抽象画
9.3阅兵全景图2-英雄连队梯队和外国方阵梯队
某某人向找小三的人宣战了
美女挤公交
BingBingFan apple dew point photo gallery1
Look at the Spring Festival people crowded into the what kind
Download software ranking
Eclipse-CALMSANNY (second edition)
Jinling thirteen stock
Unix video tutorial6
The hero
Red cliff
The Bermuda triangle2
美女游泳记
matrix3
C#程序员参考手册
Boxer's Top ten classic battle2
qq published in(发表于) 2014/7/11 9:16:05 Edit(编辑)
C#中continue语句的使用方法

C#中continue语句的使用方法

C#中continue语句的使用方法

C#中continue语句的使用方法

continue语句使执行流程跳过循环体的剩余部分而继续执行下一个循环。

示例

continue语句的使用

计数器最初是从1~6进行计数,但通过将continue语句与表达式(i<4)一起使用,可以跳过continue与for循环体末尾之间的语句。程序代码如下:

using System;

class ContinueTest

{

static void Main()

{

Console.WriteLine("输出结果为:");

// http://www.isstudy.com

for (int i = 1; i <= 6; i++)

{

if (i < 4)

{

continue;

}

Console.WriteLine(i);

}

Console.Read();

}

}


键运行程序,运行结果如图1所示。



图1 continue语句

注意:continue语句不会像break语句一样干涉循环体重复的次数,它只是影响某特定重复中的流程控制。

完整程序代码如下:

★★★★★主程序文件完整程序代码★★★★★

using System;

using System.Collections.Generic;

using System.Text;

namespace _3_12

{

class Program

{

static void Main()

{

// http://www.isstudy.com

Console.WriteLine("输出结果为:");

for (int i = 1; i <= 6; i++)

{

if (i < 4)

{

continue;

}

Console.WriteLine(i);

}

Console.Read();

}

}

}




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.