Beispiel #1
0
int main(void)
{
    integer i;

    assert(find_smallest_divisible(1, 10) == 2520);
    assert(find_smallest_divisible(1, 1) == 1);
    assert(find_smallest_divisible(1, 2) == 2);
    assert(find_smallest_divisible(1, 3) == 6);

    for (i = 1; i <= 20; ++i)
    {
        printf("Result 1..%u: %u\n", i, find_smallest_divisible(1, i));
    }
    return 0;
}
Beispiel #2
0
int main(int argc, char* argv[]) {
    if (argc < 2) {
        std::cout << "Need limit (10, 20, etc)" << std::endl;
        return -1;
    } 
    long limit = atol(argv[1]);
    long result = find_smallest_divisible(limit);
    std::cout << "RESULT: " << result << std::endl;
    return 0;
}