diff options
author | RossTheRoss <msattr@gmail.com> | 2019-02-07 19:24:11 +0000 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-02-07 19:24:11 +0000 |
commit | 6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f (patch) | |
tree | 2e362265c2a022b0cc1f69c0a966fba42d2db205 | |
parent | Fix dumb things again (diff) | |
download | homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.tar homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.tar.gz homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.tar.bz2 homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.tar.lz homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.tar.xz homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.tar.zst homework-6a3a82665ea1e12ef4ebd421c05a9b2e23ab162f.zip |
AHHHHHHHHHHHHHH
Diffstat (limited to '')
-rw-r--r-- | ee1301/wk1/lab1/strap012_lab1_c_2.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/ee1301/wk1/lab1/strap012_lab1_c_2.cpp b/ee1301/wk1/lab1/strap012_lab1_c_2.cpp index 46efd7e..c39a0c5 100644 --- a/ee1301/wk1/lab1/strap012_lab1_c_2.cpp +++ b/ee1301/wk1/lab1/strap012_lab1_c_2.cpp @@ -4,17 +4,10 @@ using namespace std; int main() { - string first; - string middle; - string last = " "; + string first, last; cout << "What is your full name?" << endl; - cin >> first >> middle >> last; - if (last == " ") - { - cout << middle << ", " << first; - } - else - { - cout << last << ", " << first << " " << middle << endl; + getline + cin >> last; + cout << last << ", " << first << } } |