📄 c09_15.c
字号:
#include <stdio.h>
#include <string.h>
int main()
{
char *question = "Where are do you want to go? [1:West, 2:North , 3:Easr , 4:South]\n",
*pwest = "West. There are a larger building.",
*pnorth = "North. There are no way.",
*peast="East. Go down, You can find a Magic Miror.",
*psouth = "South. There are an old man.";
enum location { west=1, north=2, east=3, south=4};
enum location direction;
puts(question);
scanf("%d", &direction);
switch (direction)
{
case west: puts(pwest); break;
case north: puts(pnorth); break;
case east: puts(peast); break;
case south: puts(psouth); break;
default: printf("stay here.\n"); break;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -