根据员工所掌握语言分配到相应部门:
package test;
import java.util.Scanner;
public class YuanGongFenLei {
public static void main(String[] args){
Scanner scanner=new Scanner(System.in);
System.out.println("请输入员工姓名:");
String name=scanner.nextLine();
System.out.println("请输入员工相应编程语言:");
String language=scanner.nextLine();
switch (language.hashCode()) {
case 3254818:
System.out.println("员工"+name+"被分配到java开发部门");
break;
case 3104:
System.out.println("员工"+name +"被分配到c#开发部门");
break;
case 955463181:
System.out.println("员工"+name+"被分配到asp.net部门");
default:
System.out.println("暂不需要该语言程序员!");
break;
}
}
}