public int Myfunction(int i)
{
   return    i>>  ??;
}

解决方案 »

  1.   

    楼上你好:我意思return i>> ??;中的??不一定是个数字,可能是个公式之类的~ 用某些修补方式达到移位/7的目的
      

  2.   

    http://topic.csdn.net/t/20011216/15/424414.html你参考一下这个,但是我觉得他里面两个方案都不够完美。
      

  3.   


    很感谢前辈列出的连接。
    列出C#版代码,答谢各位    public static int Myfunction(int x)
            {
                int result = 0;
                int y = x;
                while (y > 0)
                {
                    y >>= 3;
                    result += y;
                }
                while (x - ((result << 3) - result) >= 7)
                    result++;            return result;
            }