qq_周少_0
2017-09-21 11:21
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string[] t =new string[]{"C","Sh","a","rp"};
for(string i=0;i<t.Length;i++)
{
Console.Write(t[i]+" ");
}
Console.WriteLine();
foreach (string x in t)
{
Console.Write(x+" ");
}
Console.WriteLine();
}
}
}
运算符和实际有差别
string[] t =new string[]{"C","Sh","a","rp"};
for(int i=0;i<t.Length;i++) //string定义字符串
{
Console.Write(t[i]+" ");
}
Console.WriteLine();
foreach (int x in t) //string定义字符串
{
Console.Write(x+" ");
}
Console.WriteLine();
C#开发轻松入门
254118 学习 · 1459 问题
相似问题