The cost of World War 2 was more than $300 billion in the dollar of the 1940s. The government paid for it the same way it pays for most everything: taxing, borrowing and inflating. (or transferring, like the Social Security System)
Once the wartime controls expired, the economy began to recover. by Adam Young.
“The best way to destroy the capitalist system is to debauch the currency. By a continuing process of inflation, governments can confiscate, secretly and unobserved, an important part of wealth of their citizens”. John Maynard Keynes.