<span style="font-size:18px;"> int[,] ints =new int[2,3]{{1,2,3},{4,5,6}};
foreach (int temp in ints)
{
Console.WriteLine(temp);
}
Console.ReadLine();</span>
<span style="font-size:18px;"> int[,] ints =new int[2,3]{{1,2,3},{4,5,6}};
for (int i = 0; i < ints.GetLength(0); i++)
{
for (int j = 0; j < ints.GetLength(1); j++)
{
Console.WriteLine(ints[i,j]);
}
}
Console.ReadLine();</span>
<span style="font-size:18px;"> int[] a=new int[3]{1,2,3};
ArrayList arrint = new ArrayList();
arrint.AddRange(a);
foreach (int temp in arrint)
{
Console.WriteLine(temp);
}
Console.ReadLine();</span>
<span style="font-size:18px;"> int[] a=new int[3]{1,2,3};
ArrayList arrint = new ArrayList();
arrint.AddRange(a);
for (int i = 0; i < arrint.Count;i++ )
{
int n = (int)arrint[i];
Console.WriteLine(n);
}
Console.ReadLine();</span>
<span style="font-size:18px;">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace @foreach
{
class Program
{
static void Main(string[] args)
{
string str = "This is an example of a foreach";
foreach (char i in str)
{
if (char.IsWhiteSpace(i))
{
Console.WriteLine(i);//当i为空格时输出并换行
}
else
{
Console.Write(i);//当i不为空格时只是输出
}
}
Console.ReadLine();
}
}
}</span>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有