Now that you have mentioned that you have formatted the computer already and it is still restarting, it is a hardware problem for sure. The first thing I would try is the memory. From Tips4pc
Faulty random access memory (ram)Having faulty memory can cause a number of symptoms including a continual restart of Windows. I have tested this theory in a number of computers, including Acer and Dell computers. The computers were working fine until I installed the faulty memory. As soon as the bad memory is removed and the working memory is replaced the computer is fine again. Faulty memory can also cause your computer to show a complete black screen or even the blue screen of death. If you have two sticks of memory in your computer, remove one and then start your computer. If this doesn't work then swap them over and try the other one. If the computer still restarts after loading the Windows Logo screen, then try the next option.
Before you go removing ram, here is an article on it showing how to do it...also on how to open a computer case safely...http://www.tips4pc.com/Articles/Computer%20Maintenance/upgrade_your_computer_memory.htmFor your safety and your computers. You must release any static electricity that your body is holding by touching the metal parts of the computer casing. I hope it is the memory because this is the easiest piece of hardware to deal with.