我们曾经认识过for,
後来也遇到While,
如今又出现一个foreach
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsharpDemo
{
class Program
{
static void Main(string[] args)
{
//宣告一个字串阵列
string[] storyArray = { "1.我是一颗蛋", "2.破壳而出", "3.吃了几颗饲料,好饱", "4.渐渐长大成肉鸡", "5.农场主人来在大家去市场玩", "6.因为太边缘所以没上到车", "7.大家一去就没回来", "8.成为孤独一只鸡" };
Console.WriteLine("这是很久很久以前,有一只鸡的故事");
//使用foreach处理阵列
foreach(string story in storyArray)
{
Console.WriteLine(story);
}
Console.ReadKey();
}
}
}
结果
这是很久很久以前,有一只鸡的故事
1.我是一颗蛋
2.破壳而出
3.吃了几颗饲料,好饱
4.渐渐长大成肉鸡
5.农场主人来在大家去市场玩
6.因为太边缘所以没上到车
7.大家一去就没回来
8.成为孤独一只鸡
>>: 30天零负担轻松学会制作APP介面及设计【DAY 05】
说明 继上篇建立 App Registration 後,本篇将继续介绍使用MSAL透过Activat...
挑战目标: MockNative Camp 想想现在应该有三年多JAVA经验,现在公司的专案也是用J...
继续昨天的进度,首先,因为我们用了pickerview所以要扩充UI功能,写在第十一行後。 写完之後...
#993 - Cousins in Binary Tree 连结: https://leetcod...
开始实做发给 telegram 的回覆 telegram 使用 axios 来要求 telegram...