enum orientation : byte
{
north = 1,
south = 2,
east = 3,
west = 4
}
struct route
{
public orientation direction;
public double distance;
}
class Program
{
static void Main(string[] args)
{
route myRoute;
int myDirection = -1;
double myDistance;
Console.WriteLine("1) North\n2) South\n3) East\n4) West");
do
{
Console.WriteLine("Select a direction:");
myDirection = Convert.ToInt32(Console.ReadLine());
}
while ((myDirection < 1) || (myDirection > 4));
为什么myDirection要小于1或大于4
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
悬赏问题
- ¥15 这种小网站播放的音乐文件该如何下载?
- ¥15 x-tile软件报错
- ¥15 评论图片存取方案,求方法
- ¥30 麒麟系统安装设置基础软件仓库时出错
- ¥15 COMSOL溶质浸出模型构建
- ¥100 求点云SHOT的C++手写版代码
- ¥15 无界革命系统无法正常启动
- ¥15 看了正点原子的ds18b20自己跟着写完发现读出来全是1,查了一天找不出原因快哭了
- ¥16 问题:ValueError: could not broadcast input array from shape (12784,6,0) into shape (12784,6,9)
- ¥15 APP使用微信登录 怎么爬取数据