northtrex
February 15th, 2005, 12:43 PM
You simply have to build this simple function. I have 3 or 4 more contests to come. I’m building a program in C++ with more than 100 functions and to save time I want to start a few contests with a few of these functions. $10 to the first who post a working solution. If nobody is interested by the prize ($10USD) I will rise it later.
The function should :
Receive a two dimensions table and should return a simple table with a size of 50 T[50].
The two dimensions table have a miximum of 50 lines and every lines have 7 columns. Here is an exemple with a table of 5 lines :
A B C D E F G
1 3 0 0 0 0 0
2 4 0 0 0 0 0
3 4 1 0 0 0 0
4 2 1 2 0 0 0
5 7 1 3 0 0 0
Legende
A – Line number
B – Time value of X
C - D - E - F - G (We are looking for the lines where C-D-E-F-G equal to zero)
What I want is to find lines with 5 zero in a row in C-D-E-F-G. In this exemple this is line 1 and 2. Then we insert in the table T[50] at position 1 (T[0]) the number in B (3) and we insert at position 2 (T[1]) the number in B (4). Then we return T[50].
In fact, every position of T[50] represent a line. The first line is represented by T[0], line 2 by T[1], line 3 by T[2] and line N by T[N-1]… This table contain the time value (B) of lines who have 5 zeros in a row.
I put as many details as I can to be sure you understand my problem. Do not hesitate to contact me if you have more questions.
Good luck!
The function should :
Receive a two dimensions table and should return a simple table with a size of 50 T[50].
The two dimensions table have a miximum of 50 lines and every lines have 7 columns. Here is an exemple with a table of 5 lines :
A B C D E F G
1 3 0 0 0 0 0
2 4 0 0 0 0 0
3 4 1 0 0 0 0
4 2 1 2 0 0 0
5 7 1 3 0 0 0
Legende
A – Line number
B – Time value of X
C - D - E - F - G (We are looking for the lines where C-D-E-F-G equal to zero)
What I want is to find lines with 5 zero in a row in C-D-E-F-G. In this exemple this is line 1 and 2. Then we insert in the table T[50] at position 1 (T[0]) the number in B (3) and we insert at position 2 (T[1]) the number in B (4). Then we return T[50].
In fact, every position of T[50] represent a line. The first line is represented by T[0], line 2 by T[1], line 3 by T[2] and line N by T[N-1]… This table contain the time value (B) of lines who have 5 zeros in a row.
I put as many details as I can to be sure you understand my problem. Do not hesitate to contact me if you have more questions.
Good luck!