divisible = 0;
low = input('Start Value: ');
high = input('End Value: ');
divisor = input('Divisor: ');
mask = mod([low:high],divisor);
for index = low:high
if mask(index) == 0
divisible = divisible + 1;
end
end
这个想法是计算没有余数的次数。