# Parkside's Other Triangle

• 02-01-2009
jegland
Parkside's Other Triangle
Here's what the book says:
Parkside's Other Triangle is generated from two positive integers, one for the size and one for the seed. For example,

Size 6, Seed 1

1 2 4 7 2 7
3 5 8 3 8
6 9 4 9
1 5 1
6 2
3

Size gives the number of columns. Seed specifies the starting value for column 1. Column n contains n values. The successive values are obtained by adding 1 to the previous value. When 9 is reached, the next value becomes 1.
Write a program that reads pairs of positive integers and produces Parkside's Other Triangle for each pair.

This is what I have so far:

Code:

```#include <iostream> #include <stdlib.h> using namespace std; int main () {     int size, seed, LCV;     cout << "Enter the size: ";     cin >> size;     cout << "Enter the seed: ";     cin >> seed;       return 0; }```
All it does is ask for the size and the seed and you can input the values you want.
Im supposed to use nested "for" loops to produce the triangle thing in the example i gave above.
Like:

for(---;---;---)
for(---;---;---)
command;

I cant use super advanced stuff, all we've learned so far is loops and conditional statements, variables, and basic commands.

If you can help, Thanks!
• 02-01-2009
jegland
ugh, it messed up the triangle

1 2 4 7 2 7
--3 5 8 3 8
----6 9 4 9
------1 5 1
---------6 2
-----------3

Thats how its supposed to look, ignore the dashes
• 02-01-2009
cyberfish
http://cboard.cprogramming.com/annou...t.php?f=3&a=39

And your code won't cut it.

It's like saying, this is what I have so far -
Code:

```int main() { }```
• 02-01-2009
jegland

Code:

```         for(seed; seed <= size; seed++)         {                        cout << seed << " ";         }```
Ive got the right number of columns, just the wrong numbers
• 02-02-2009
vart
Quote:

Originally Posted by jegland
```         for(seed; seed <= size; seed++)         {                        cout << seed << " ";         }```