string str = Console.ReadLine();
switch (str) {
case "gosoa":
Console.WriteLine("www.gosoa.com.cn");
break;
case "163":
Console.WriteLine("www.163.com");
break;
default:
Console.WriteLine("www.cnblogs.com");
break;
}
case 後必須為常數,不可為變數。case 結尾為冒號 :。case 後必須有 break(除非刻意貫穿)。default:所有 case 皆不符合時執行。