public static void test(String str) {
switch(str) {
case "抽烟":
System.out.println("50年");
break;
case "槟榔":
System.out.println("30年");
break;
case "撸":
System.out.println("40年");
break;
case "抽烟+槟榔+撸":
System.out.println("当场死亡");
break;
default:
System.out.println("已升仙");
}
}
public static void main(String[] args) {
test("抽烟+槟榔+撸");
}
这个没有规则是无法计算的。