Only just spotted this thread...
About a decade ago I lost a PC due to a power failure.
Where we live, despite it being an industrial inner city area in the UK where these things aren't supposed to happen, we typically get a couple of power cuts a year. Apparently the problem is that lots of the high-voltage cabling is (very) old and underground and suffers from water ingress. Which means power cuts. The electricity people won't replace the entire cabling because it's a huge job that would take ages and badly upset their profits. So they keep patching things up and have been for about 25 years.
Anyway, we usually get a few minutes warning as the power flickers a bit before dying. This one time, with no warning, the power went completely off and back on again something like 10 times in two or three seconds then cut completely.
On restarting the PC some of the magic blue smoke got out. I opened it up to find a big burst capacitor in the psu and some charred areas on the motherboard.
So we got a good quality UPS. Which has finally gone out of service this week because its' second set of lead-acid batteries finally expired, which they seem to do every five years or so, and both the UPS and the required batteries haven't been manufactured for several years. The UPS wasn't cheap, but it handled quite a number of power cuts giving ample time for Windows to automatically shut down when the UPS notified it of a power failure.
Still looking for a replacement, the cheap consumer "UPSs" are rubbish, to keep a PC and screen running for the 30-60 seconds an automatic or manual shutdown takes requires more power than many of them can supply. They also tend to be a switching supply serving a square-wave current not sine wave which has implications as well. Some psus really don't like that kind of AC.
I guess the answer is to use just laptops because they're power-cut proof, though they come with their own sets of issues.