/****************************************************************************** * This program computes the size of the universe. * * Copyright © 2016 Richard Lesh. All rights reserved. *****************************************************************************/ #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; static double const universeSizeInGParsecs = 14.26; static double const gigaParsec = 10e9; static double const parsecInLightYears = 3.261563777167433562; static double const lightYearInMeters = 9460730472580800.; int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); double universeSizeInMeters; universeSizeInMeters = universeSizeInGParsecs * gigaParsec * parsecInLightYears * lightYearInMeters; wcout << L"The Universe is " << universeSizeInMeters << L"m across" << endl; return 0; }