要求: a,b,c,d,e,f 若干数  。
           
          判断运行时是a和c 的话,必须单独运行,其他都是20个一组运行          

解决方案 »

  1.   

    switch?
      

  2.   

    我是这样的思路:
    假设数据长度为NumLength,存储数据的数组为arrNum[NumLength];
    int count = 0;
    for(int i=0; i<NumLength; i++)
    {
            if(arrNum[i] == a)
                    funa();
           else if(arrNum[i] == c)
                   func();
           else
                   count++;
           if(count == 20)
           {
                    count = 0;
                    funother();
           }
              
    }
      

  3.   

    int count = 0;
    for(int i=0; i<NumLength; i++)
    {
            if(arrNum[i] == a)
                    funa();
           else if(arrNum[i] == c)
                   func();
           else
                   count++;
           if(count == 20)
           {
                    count = 0;
                    funother();
           }
              
    }