On the determination of temperatures of ionizing stars in H II regions