40以内的所有3得倍数有3,6,9,12,15,18,21,24,27,30,33,36,39共13个,它们的平均数是(3+6+9+12+15+18+21+24+27+30+33+36+39)÷13=273÷13=21