Recently, xmake's description syntax has been enhanced to support two different grammar styles at the same time.
The set-add style
The key-val style
The set-add style
This is xmake's classic style, for example:
lua
target("test")
set_kind("static")
add_defines("DEBUG")
add_files("src/*.c", "test/*.cpp")
继续阅读 »
分析:最直接的想法是如下代码:
cpp
bool on = false;
for (int i = 1; i <=n; i++)
if (n % i == 0)
on = !on
但n最大可达数十亿,此法计算效率太低!那么能不能倒过来想:n可以被多少个不大于n的数整除?很容易给n分解质因数:more继续阅读 »