interface llist
{}
class Nil : llist {}
class Cons : llist
{
public
A head;
public llist tail;
public Cons(A h, llist t) {head=h; tail=t;}
}
public class llists
{
static string check(llist m)
{
string answer = "";
if (m is Nil) answer = "empty";
else if (m is Cons) {
if (((Cons)m).tail is Cons) answer= "at least two";
else answer = "just one";
}
return answer;
}//checkp
public static void Main()
{
System.Console.WriteLine( check(new Cons(2,new Nil())) );
}
}