zoukankan      html  css  js  c++  java
  • 计算生肖

    公元268年应该是鼠年.

    生肖计算法:
    用(现在的年)2006/12(12生肖)=167~2(年)
      因为2006年是属狗年,那么余数中的2年(为公元2年)同样也是狗年。
    同样公元268年计算法:
    268/12=22~4(年)
    因为公元2年为狗年,那么余数中的4年(为公元4年)就应该是鼠年.
      因为公元4年是鼠年,那么公元268年也应该是鼠年.

    Code
    public static string GetSNETMemberZodiacChineseName(DateTime birthdayYear)
        {
            
    int i = birthdayYear.Year % 12;
            
    switch (i)
            {
                
    case 4:
                    
    return "";
                    
    break;
                
    case 5:
                    
    return "";
                    
    break;
                
    case 6:
                    
    return "";
                    
    break;
                
    case 7:
                    
    return "";
                    
    break;
                
    case 8:
                    
    return "";
                    
    break;
                
    case 9:
                    
    return "";
                    
    break;
                
    case 10:
                    
    return "";
                    
    break;
                
    case 11:
                    
    return "11";
                    
    break;
                
    case 0:
                    
    return "";
                    
    break;
                
    case 1:
                    
    return "";
                    
    break;
                
    case 2:
                    
    return ""
                    
    break;
                
    case 3:
                    
    return "";
                    
    break;
                
    default:
                    
    break;
            }
            
    return "";
        }
  • 相关阅读:
    LeetCode第三题:Longest Substring Without Repeating Characters
    LeetCode第二题:Add Two Numbers
    LeetCode第一题:Two Sum
    第五章 单体内置对象
    第五章 引用类型 基本包装类型
    第五章 引用类型 Function 类型
    第五章 引用类型 RegExp 类型
    第五章 引用类型 Date类型
    第五章 引用类型 Array类型
    第五章 引用类型 Object类型
  • 原文地址:https://www.cnblogs.com/jinweida/p/1455128.html
Copyright © 2011-2022 走看看