Cao Huan, ch.曹奐, py. cáo hùan, wg. Ts'ao-Huan (between 245 and 247-303) was a grandson of Cao Pi and last emperor of the Kingdom of Wei. He is also known as the Emperor Yuan of Wei, ch. 魏元帝, py. wèi yúan dì, wg. Wei Yüan-ti.
Yuandi's son, Chengdi, became emperor in 32 BCE, at nineteen, and he also also had little enthusiasm for governing and was most concerned with personal pleasures, including visiting houses of prostitution at night.
Militarily, Wei was the strongest of militarily of the three kingdoms, a strength bolstered by its economy and water transport.
Then Wei's ruler was overthrown from within, one of his generals beginning a dynasty of his own, and, thirty-six years later, in 280, his offspring, Jin Wudi, overpowered and annexed the kingdom of Wu.