unsigned count_reversible(unsigned limit) { unsigned counter = 0; unsigned i; for (i = 1; i < limit; ++i) { if (is_reversible(i)) { ++counter; } } return counter; }
int main(int argc, char *argv[]) { int i; int count; for(i = 1, count=0;i<1000000000;++i) { int is = is_reversible(i); count += is; } printf("%d\n", count); return 0; }