移位运算符,如何表达N/7的逻辑? public int Myfunction(int i){ return i>> ??;} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上你好:我意思return i>> ??;中的??不一定是个数字,可能是个公式之类的~ 用某些修补方式达到移位/7的目的 http://topic.csdn.net/t/20011216/15/424414.html你参考一下这个,但是我觉得他里面两个方案都不够完美。 很感谢前辈列出的连接。列出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; } VS2012安装失败 excel读取 C#正则表达式数字前面的数据的提取 做过工作流中消息服务的高手请进 组合框载入字体问题!! WinForm生命变量问题 一个对象的内存模型 求正则表达式:url(abc.jpg),如何将这个字符串分为两个部分? 怎样得到鼠标坐标? 拖放一个文件到form得到他的path,如何做呢? 请问怎么把dataGridView里面的数据进行,去重 如何删除一个dataGridView选中的行
很感谢前辈列出的连接。
列出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;
}