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_HW4A.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'ee1301/wk4/hw4_directory/strap012_HW4A.cpp') diff --git a/ee1301/wk4/hw4_directory/strap012_HW4A.cpp b/ee1301/wk4/hw4_directory/strap012_HW4A.cpp index fa67e7d..abedc7a 100644 --- a/ee1301/wk4/hw4_directory/strap012_HW4A.cpp +++ b/ee1301/wk4/hw4_directory/strap012_HW4A.cpp @@ -29,31 +29,31 @@ int main () { } else if (score>80) { B++; } else if (score>70) { - C++; //Nice. + C++; } else if (score>60) { D++; } else { F++; } } - std::cout << A << " A\n" - << B << " B\n" - << C << " C\n" - << D << " D\n" - << F << " F\n"; + std::cout << A << " A" << std::endl + << B << " B" << std::endl + << C << " C" << std::endl + << D << " D" << std::endl + << F << " F" << std::endl; fin.close(); fout.open("output_files/statistics.csv"); if (!fout.is_open()) { - std::cout << "File write failed!"; + std::cout << "File write failed!\n"; return -2; } - fout << "Grade, NumStudents" - << "\nA," << A - << "\nB," << B - << "\nC," << C - << "\nD," << D - << "\nF," << F; + fout << "Grade, NumStudents" << std::endl + << "A," << A << std::endl + << "B," << B << std::endl + << "C," << C << std::endl + << "D," << D << std::endl + << "F," << F; fout.close(); } \ No newline at end of file -- cgit v1.2.3