class Ticket
{
public Ticket(double distance)
{
if (distance >= 0)
this.distance = distance;
else
throw new Exception("距离不能为负数");
}
public double distance { get; }
}
class Ticket
{
public Ticket(double distance)
{
if (distance >= 0)
this.distance = distance;
else
throw new Exception("距离不能为负数");
}
public double distance { get; }
}