日期:2014-05-17  浏览次数:21072 次

超急!明天就得交作业!菜鸟求助!请大神帮忙解决下这个异常
 public class Judgement
    {

        public static bool isOnSameLine(ArrayList positionarraylistR, ArrayList positionarraylistB)
        {
            try
            {
                ArrayList CombineArraylistContainer = new ArrayList();
                foreach (int i in positionarraylistR)
                    CombineArraylistContainer.Add(positionarraylistR[i]);
                foreach (int i in positionarraylistB)
                    CombineArraylistContainer.Add(positionarraylistB[i]);
                bool tag = true;
                for (int i = 0; i < CombineArraylistContainer.Count; i++)
                {
                    for (int j = i + 1; j < CombineArraylistContainer.Count; j++)
                    {
                        for (int k = j + 1; k < CombineArraylistContainer.Count; k++)
                        {
                            double z = (((double[])(CombineArraylistContainer[k]))[2] - ((double[])(CombineArraylistContainer[i]))[2]) * (((double[])(CombineArraylistContainer[k]))[1] - ((double[])(CombineArraylistContainer[j]))[1]) -
                                (((double[])(CombineArraylistContainer[k]))[2] - ((double[])(CombineArraylistContainer[j]))[2]) * (((double[])(CombineArraylistContainer[k]))[1] - ((double[])(CombineArraylistContainer[i]))[1]);
                            if (z == 0)
                                tag = false;
                     &nb