基本用法 switch(){ case 1: //... break; case 2: //... break; default: //... break; } 注意 不能直接用于string, 可以考虑用map将string对应于int型,再用switch