From d3173832fda7d1471ad770400391963084a3b7afb3757dcde591afd98b4db5a5 Mon Sep 17 00:00:00 2001 From: Tyler Beckman Date: Tue, 24 Sep 2024 00:37:14 -0600 Subject: [PATCH] format --- main.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/main.cpp b/main.cpp index 225497e..bcee382 100644 --- a/main.cpp +++ b/main.cpp @@ -10,31 +10,31 @@ #include int main(void) { - std::ifstream secretMessage("secretMessage.txt"); - if (secretMessage.fail()) { - std::cerr << "Error opening secretMessage.txt file" << std::endl; - return -1; - } + std::ifstream secretMessage("secretMessage.txt"); + if (secretMessage.fail()) { + std::cerr << "Error opening secretMessage.txt file" << std::endl; + return -1; + } - std::ofstream decipheredMessage("decipheredMessage.txt"); - if (decipheredMessage.fail()) { - std::cerr << "Error opening decipheredMessage.txt" << std::endl; - return -1; - } + std::ofstream decipheredMessage("decipheredMessage.txt"); + if (decipheredMessage.fail()) { + std::cerr << "Error opening decipheredMessage.txt" << std::endl; + return -1; + } - char currentChar; - while (secretMessage.get(currentChar)) { - switch (currentChar) { - case '\n': - decipheredMessage << std::endl; - break; - case '~': - decipheredMessage << ' '; - break; - default: - decipheredMessage << (char)(currentChar + 1); - } - } + char currentChar; + while (secretMessage.get(currentChar)) { + switch (currentChar) { + case '\n': + decipheredMessage << std::endl; + break; + case '~': + decipheredMessage << ' '; + break; + default: + decipheredMessage << (char)(currentChar + 1); + } + } - decipheredMessage.close(); + decipheredMessage.close(); }