From 322d862898bbafd84a33ff0dfc03f34e365fffeb Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Sun, 3 Feb 2019 13:13:55 -0600 Subject: Fixin things, breaking others --- ee1301/wk1/lab1/strap012_lab1_c_2.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ee1301/wk1/lab1/strap012_lab1_c_2.cpp') diff --git a/ee1301/wk1/lab1/strap012_lab1_c_2.cpp b/ee1301/wk1/lab1/strap012_lab1_c_2.cpp index e69de29..941d8de 100644 --- a/ee1301/wk1/lab1/strap012_lab1_c_2.cpp +++ b/ee1301/wk1/lab1/strap012_lab1_c_2.cpp @@ -0,0 +1,19 @@ +#include +using namespace std; + +int main() +{ + string first; + string middle; + string last = " "; + cout << "What is your full name?" << endl; + cin >> first >> middle >> last; + if (last == " ") + { + cout << middle << ", " << first; + } + else + { + cout << last << ", " << first << " " << middle << endl; + } +} -- cgit v1.2.3