aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWiserJ <[email protected]>2021-10-19 15:52:37 -0700
committerWiserJ <[email protected]>2021-10-19 15:52:37 -0700
commit5a14fae64e0d1f9be0880ef7eebb116af0b96cbf (patch)
treea8430e3fe974ef2f787c98b7349b23198ad2cd12
parentp.184 (diff)
downloadcst116-lab3-jeffwoit-5a14fae64e0d1f9be0880ef7eebb116af0b96cbf.tar.xz
cst116-lab3-jeffwoit-5a14fae64e0d1f9be0880ef7eebb116af0b96cbf.zip
p.192a
-rw-r--r--CST116F2021-Lab3/CST116F2021-Lab3.cpp59
1 files changed, 40 insertions, 19 deletions
diff --git a/CST116F2021-Lab3/CST116F2021-Lab3.cpp b/CST116F2021-Lab3/CST116F2021-Lab3.cpp
index 7db63d6..61ab7aa 100644
--- a/CST116F2021-Lab3/CST116F2021-Lab3.cpp
+++ b/CST116F2021-Lab3/CST116F2021-Lab3.cpp
@@ -7,29 +7,50 @@ using namespace std;
int main()
{
- //p.184
-
- int length = 0;
- int height = 1;
-
- cout << "Please input the base length of your triangle: ";
- cin >> length;
-
- height = length;
- do {
- do
- {
- cout << '*';
- length = length--;
- } while (length != 0);
- cout << "\n";
- height = height--;
- length = height;
- } while (height != 0);
+ //p.192
+
+ int input = 0, seq1 = 0, seq2 = 0;
+
+
+ cout << "Please enter your ending number: ";
+ cin >> input;
+
+ do
+ {
+ if (seq1 == 0)
+ seq1 = seq1++;
+
+ seq2 = seq1 + seq2;
+ } while (seq1 <= input || seq2 <= input);
return 0;
+
+
+ ////p.184
+
+ //int length = 0;
+ //int height = 1;
+
+ //cout << "Please input the base length of your triangle: ";
+ //cin >> length;
+
+ //height = length;
+ //do {
+ // do
+ // {
+ // cout << '*';
+ // length = length--;
+ // } while (length != 0);
+ // cout << "\n";
+ // height = height--;
+ // length = height;
+ //} while (height != 0);
+
+ //return 0;
+
+
//p.179
/*int input = 0;