主题:这里要怎么修改呀
using System;
namespace ddr
{
enum orientation : byte
{
north = 1,
south = 2,
east = 3,
west = 4
}
struct route
{
public orientation direction;
public double distance;
}
///<summary>
///summary dexcription for Class1=-1;
///</summary>
class Class1
{
static void Main(string[] args)
{
route myRoute;
int myDirection = -1;
double myDirtance;
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));
Console.WriteLine("Input a distance:");
myDirtance = Convert.ToDouble(Console.ReadLine());
myRoute.direction = (orientation)myDirection;
myRoute.dirtance = myDirtance;
Console.WriteLine("myRoute specifies adirection of {0} and a " + " distanceof {1}", myRoute.direction,
myRoute.dirtance);
}
}
}
错误 1 “ddr.route”并不包含“dirtance”的定义 C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\lianxi\lianxi\Program.cs 36 21 lianxi
错误 2 “ddr.route”并不包含“dirtance”的定义 C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\lianxi\lianxi\Program.cs 38 25 lianxi
请问这里要怎么修改呀
namespace ddr
{
enum orientation : byte
{
north = 1,
south = 2,
east = 3,
west = 4
}
struct route
{
public orientation direction;
public double distance;
}
///<summary>
///summary dexcription for Class1=-1;
///</summary>
class Class1
{
static void Main(string[] args)
{
route myRoute;
int myDirection = -1;
double myDirtance;
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));
Console.WriteLine("Input a distance:");
myDirtance = Convert.ToDouble(Console.ReadLine());
myRoute.direction = (orientation)myDirection;
myRoute.dirtance = myDirtance;
Console.WriteLine("myRoute specifies adirection of {0} and a " + " distanceof {1}", myRoute.direction,
myRoute.dirtance);
}
}
}
错误 1 “ddr.route”并不包含“dirtance”的定义 C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\lianxi\lianxi\Program.cs 36 21 lianxi
错误 2 “ddr.route”并不包含“dirtance”的定义 C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\lianxi\lianxi\Program.cs 38 25 lianxi
请问这里要怎么修改呀