Up to half of all middle-aged and older men are affected by erectile dysfunction, and the answer may not be a little blue pill. Men who eat foods rich in flavonoids are less likely to suffer from the condition, and that risk is even lower if they also exercise regularly.