From 175721a63b426355274fa9e8063f762020ab8362 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Thu, 30 Jan 2020 16:55:04 -0600 Subject: R E A R R A N G E --- OLD/ee1301/wk2/hw2_directory/strap012_HW2A.cpp | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 OLD/ee1301/wk2/hw2_directory/strap012_HW2A.cpp (limited to 'OLD/ee1301/wk2/hw2_directory/strap012_HW2A.cpp') diff --git a/OLD/ee1301/wk2/hw2_directory/strap012_HW2A.cpp b/OLD/ee1301/wk2/hw2_directory/strap012_HW2A.cpp new file mode 100644 index 0000000..2877801 --- /dev/null +++ b/OLD/ee1301/wk2/hw2_directory/strap012_HW2A.cpp @@ -0,0 +1,49 @@ +/* +20 Feb 2019 +Matthew Strapp +5449340 +EE1301 +Spring 2019 +Homework 2A +Useless Counter +*/ + +#include +using namespace std; +int main () { + int countOG, i, j; + +do { + + do { + cout << "Enter an integer from -50 to 50: "; + cin >> countOG; + } while (countOG > 50 || countOG < -50); + + int count=countOG; //Store original integer for comparison to break loop + + if (countOG < 0){ + count*=-1; + for (i=count; i>0; i--) { + for (j=count; j>0; j--) { + cout << count; + } + count--; + cout << endl; + } + } + + if (countOG > 0) { + for (count=1; count<=countOG; count++) { + for (i=0; i