using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Test
{
static void Main(string[] args)
{
int a = 5;
int[] b = {
1, 2, 3, 4, 5, 6, 7, 8 };
int c = 0;
for (int i = 0; i < a; i++)
{
Console.WriteLine("i:" + i);
}
foreach (var item in b)
{
Console.WriteLine("b[" + c++ +"]:" + item);
}
Console.ReadLine();
}
}
}
更多【c#-C# 循环】相关视频教程:www.yxfzedu.com