111,092
社区成员




// 虚构的二维 数组
public class TowArray
{
public List<List<object>> data = new List<List<object>>();
public object this[int index1, int index2]
{
get
{
if (index1 < data.Count && index2 < data[index1].Count)
{
return data[index1][index2];
}
else
{
return null;
}
}
set
{
while (index1 >= data.Count)
{
data.Add(new List<object>());
}
while (index2 >= data[index1].Count)
{
data[index1].Add(null);
}
data[index1][index2] = value;
}
}
}
class TimePeriod
{
private double seconds;
public double Hours
{
get { return seconds / 3600; }
set { seconds = value * 3600; }
}
}
class TimePeriod
{
private double seconds;
public double setHours(double h)
{
this.seconds = h* 3600;
}
public double getHours()
{
return this.seconds /3600;
}
}