From e6d9e367d2e87ef00fddae9d3c61041d95488225 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Sun, 10 Mar 2019 16:24:04 -0500 Subject: Change \n to std::endl --- ee1301/wk4/hw4_directory/strap012_HW4C.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'ee1301/wk4/hw4_directory/strap012_HW4C.cpp') diff --git a/ee1301/wk4/hw4_directory/strap012_HW4C.cpp b/ee1301/wk4/hw4_directory/strap012_HW4C.cpp index 7c916e3..2041150 100644 --- a/ee1301/wk4/hw4_directory/strap012_HW4C.cpp +++ b/ee1301/wk4/hw4_directory/strap012_HW4C.cpp @@ -35,6 +35,7 @@ int main() U++; } } fin.close(); + //This bit compares to see which vowel wins. if (A>E && A>I && A>O && A>U) winner = 'A'; if (E > A && E > I && E > O && E > U) @@ -46,14 +47,14 @@ int main() if (U > E && U > I && U > O && U > A) winner = 'U'; - std::cout << "The results are in!\n" - << "A/a received " << A << " votes\n" - << "E/e received " << E << " votes\n" - << "I/i received " << I << " votes\n" - << "O/o received " << O << " votes\n" - << "U/u received " << U << " votes\n" + std::cout << "The results are in!" << std::endl + << "A/a received " << A << " votes" << std::endl + << "E/e received " << E << " votes" << std::endl + << "I/i received " << I << " votes" << std::endl + << "O/o received " << O << " votes" << std::endl + << "U/u received " << U << " votes" << std::endl << "The winner is the letter \"" << winner - << "\"!\n"; + << "\"!" << std::endl; fout.open("output_files/election_results.txt"); @@ -61,10 +62,10 @@ int main() std::cout << "File write failed!\n"; return -2; } - fout << "A," << A - << "\nE," << E - << "\nI," << I - << "\nO," << O - << "\nU," << U; + fout << "A," << A << std::endl + << "E," << std::endl + << "I," << std::endl + << "O," << std::endl + << "U," << U; fout.close(); } \ No newline at end of file -- cgit v1.2.3