• java判断姓是否合格 百家姓


    package util;
    
    import java.lang.reflect.Array;
    
    public class FirstName {
        
        public static boolean ClearName(String name){
            String[] surName = {
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","羿",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","宿","","怀","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "寿","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","广","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","","","","","","","","","",
                    "","",
                    "万俟","司马","上官","欧阳","夏侯",
                    "诸葛","闻人","东方","赫连","皇甫",
                    "尉迟","公羊","澹台","公冶","宗政",
                    "濮阳","淳于","单于","太叔","申屠",
                    "公孙","仲孙","轩辕","令狐","锺离",
                    "宇文","长孙","慕容","鲜于","闾丘",
                    "司徒","司空","丌官","司寇","南宫",
                    "子车","颛孙","端木","巫马","公西",
                    "漆雕","乐正","壤驷","公良","拓拔",
                    "夹谷","宰父","谷梁","段干","百里",
                    "东郭","南门","呼延","羊舌","微生",
                    "梁丘","左丘","东门","西门"
                    }; 
            
            String firstName = name.substring(0,1);
            for(String s : surName){
                String s1 = s.substring(0,1);
                if(s.contains(firstName)){
                    return true;
                }
            }
            return false;
            
        }
        public static void main(String[] args) {
            String name = "张三";
            System.out.println(ClearName(name));
        }
    }
  • 相关阅读:
    hdu 2669 Romantic 扩展欧几里德
    fzu 1759 Super A^B mod C 大数幂取模
    POJ2429 SCU2106 GCD & LCM Inverse
    spring和hibernate整合时报sessionFactory无法获取默认Bean Validation factory
    SSH Secure Shell Client安装和使用
    乔布斯在斯坦福大学的演讲
    Java 事件处理机制
    Java 网络编程 简单接触TCP
    设计模式 职责链模式
    设计模式 命令模式
  • 原文地址:https://www.cnblogs.com/tnsay/p/5892721.html
Copyright © 2020-2023  润新知