switch-case块内声明变量

case块内用{}包裹即可
原文地址:https://www.cnblogs.com/vagrantatbeijing/p/3430928.html