免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 回復 發帖

從年份計算中國生肖年

public string SelectSX(int intYear)
        {
            string strText = "";
            switch (intYear % 12)
            {
                case 4:
                    strText = "鼠";
                    break;
                case 5:
                    strText = "牛";
                    break;
                case 6:
                    strText = "虎";
                    break;
                case 7:
                    strText = "兔";
                    break;
                case 8:
                    strText = "龍";
                    break;
                case 9:
                    strText = "蛇";
                    break;
                case 10:
                    strText = "馬";
                    break;
                case 11:
                    strText = "羊";
                    break;
                case 0:
                    strText = "猴";
                    break;
                case 1:
                    strText = "雞";
                    break;
                case 2:
                    strText = "狗";
                    break;
                case 3:
                    strText = "豬";
                    break;
            }
            return strText;
        }
返回列表