The temperature of solar flares determined from X-ray spectral line ratios