📜  c#代码示例中的打印数组

📅  最后修改于: 2022-03-11 14:48:58.935000             🧑  作者: Mango

代码示例3
//array of numbers, it works with strings also
int numbers[3] = {1, 4, 5, 6}

/*declares int named 'number' and assigns it the value of an index
starting from index 0 to the end of the array, in this case, 3*/
foreach(int number in numbers){
  //prints the number
  Console.WriteLine(number);
}