C#基础 out传值

时间:2016-07-03 12:59:22   收藏:0   阅读:255

public void Out(out int a, out int b)
{//out相当于return返回值
//可以返回多个值
//拿过来变量名的时候,里面默认为空值
a=1;
b=2;
}


static void Main(string[] args)
{
int a = 0;
int b = 1;
Program hanshu = new Program();
hanshu.Out(out a, out b);

 

//100以内与7无关的数
//个位数是7
//十位数是7
//7的倍数

for (int i = 1; i <= 100;i++ )
{
if (i % 10 == 7 || i / 10 == 7 || i % 7 == 0)
{
//break;//跳出整个循环
continue;//跳出本次循环,继续下次循环
}
Console.Write(i+"\t");
}
Console.ReadLine();技术分享

 

原文:http://www.cnblogs.com/dreamer666/p/5637765.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!