```
#include <stdio.h>
#define MINNUM 0
#define MAXNUM 1000
int main()
{
int n, j, i, tempn, ndigits, subseq, pow10, count, oc, divisor, sum, count2;
count2 = 0;
oc = 0;
for (n = 1 ; n <= MAXNUM ; n++){
sum = 1 ;
for (divisor=2; divisor * divisor < n; divisor++) {
if(n%divisor==0){
sum += divisor + n / divisor;
}
}
if (divisor * divisor == n) {
sum += divisor;
}
if (sum > n) {
count2++;
}
}
for (n = MINNUM ; n <= MAXNUM ; n++){
tempn = n;
ndigits = 0;
while (tempn != 0){
ndigits++;
tempn /= 10;
}
pow10 = 1;
count = 0;
for (j=1; j<= ndigits; j++) {
pow10 *= 10;
tempn = n;
for (i=1; i<=ndigits -j+1; i++){
subseq = tempn % pow10;
if (subseq % ndigits == 0) {
count++;
if (count == 1) {oc++; }
if (count == 2) {oc--; }
}
tempn /= 10;
}
}
}
printf("Found %d abundant numbers\nFound %d only-child numbers \n",count2, oc);
}
```