int div(const int x, const int y)
{
	int left_num = x;
	int result = 0;
	while (left_num >= y)
	{
		int multi = 1;
		while (y * multi <= (left_num >> 1))
		{
			multi = multi << 1;
		}
		result += multi;
		left_num -= y * multi;
	}
	return result;
}

  

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2021-11-23
  • 2021-12-25
  • 2022-12-23
  • 2021-11-04
  • 2021-07-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案