Preparing profiles and dependencies, but added testing to separate them from regular targets and avoid the need for a 'testing' profile which could negatively impact configuration size and readability.
13 lines
231 B
C++
13 lines
231 B
C++
int factorial(int start) {
|
|
if (start < 0)
|
|
return 0;
|
|
|
|
auto result = 1;
|
|
for (auto index = 2; index < start; index++)
|
|
result *= index;
|
|
return result;
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
return factorial(5) == 120;
|
|
} |