第(2题)怎么做,c#
展开全部
namespace ConsoleApplication2
{
class Program
{
//枚举
private enum colors
{
Red = 0,
Yellow = 1,
Blue = 2,
White = 3,
Black = 4
}
//根据int获取枚举值
private static string show(int i)
{
colors res = (colors)Enum.Parse(typeof(colors), i.ToString());
return res.ToString();
}
//主运行
static void Main(string[] args)
{
for (int i = 0; i < 3; i++)
{
for (int j = i+1; j < 4; j++)
{
for (int k = j+1; k < 5; k++)
{
Console.WriteLine("{0}\t{1}\t{2}",show(i),show(j),show(k));
}
}
}
Console.ReadLine();
}
}
}
追问
好人,回家我试试,能用给你100
拿去买糖吃
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询