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();C#基础 out传值

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-06-14
  • 2021-10-30
猜你喜欢
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案