我的C#代碼的操作數:不能被應用於類型「INT」和「INT」」
public int printallancestor(Node root, Node key)
{
if(root == null)
return 0;
if(root == key)
return 1;
if(printallancestor(root.leftChild,key)||printallancestor(root.rightChild,key))
{
Console.WriteLine(root.iData);
return 1;
}
return 0;
}
從上面的代碼我得到以下錯誤下面的行if(printallancestor(root.leftChild,key)||printallancestor(root.rightChild,key))
不能被應用於類型的操作數「詮釋'和‘廉政’什麼不對這個