You can only put global variables anywhere in the program while with local variables it can only be used within the function. You're only allowed to use local variables in different functions and not the same variable in the same function.
(A) the same, by applying styles the same formats are being applied each time.
I think you need to reinstall the windows first then try to install any good malware/ antivirus software's such as avira, malewarebytes etc. to scan and clean any viruses and bugs that are preventing windows from running normally.