C#的问题

[复制链接]
查看11 | 回复3 | 2009-3-12 22:42:53 | 显示全部楼层 |阅读模式
enumlin

{ north=1,south=2,east=3}

struct op

{

public int day;

public int month;

public int year;



}



class Program

{

static void Main(string[] args)

{

lin ou=lin.east;

Console.WriteLine("{0}",Convert.ToInt32(ou));
Console.ReadKey();

}
我想在枚举中把east=3改成east=三;
之后输出“三”或east”

但是改后出现问题?

请哪位大侠帮忙。。。

回复

使用道具 举报

千问 | 2009-3-12 22:42:53 | 显示全部楼层
我真有想法 测试可行,相信您可以自己继续修改public static void Main() { Console.WriteLine(a.三.ToString()); } public enum a { 一=0, 二=1, 三 }...
回复

使用道具 举报

千问 | 2009-3-12 22:42:53 | 显示全部楼层
enum lin:string { north="一",south="二",east="三"} 这样你再试试。。...
回复

使用道具 举报

千问 | 2009-3-12 22:42:53 | 显示全部楼层
注意下数据类型 就OK了3是int 三是string...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行