- #1
theisonews
- 3
- 0
help me with this vector program
i want to create a program that will have an arraycalled array1[] of 30 sets of 3 one digit numbers i.e 804, 450,430 etc)
i will have 13 vector containersor arrays defined with a series of 3 one digit numbers. i want the program to find any series of numbers that is array1[] in any of the 13 vectors. and it will tell me in which vector the series was found in
also the order of the number shouldn't matter for example vector<int> first_tier (324)
the program should compare the values of one vector to an other vector for reoccuring series and it finds it in first_tier because 3 so which function do i use to do this. this is what i got so far
#include <iostream>
#include <algorithm>
using namespace std;
int * p; // points to array element
int main()
{
int First_tier[]={409 , 508 , 509, 607, 608 ,707 , 139 , 148 , 149 , 157 , 158 ,166 , 167 ,229 , 238 , 239 ,247 , 248 ,256 ,257 ,266 ,337 ,338 ,346 ,347 , 355 , 356 , 445 , 446 ,455};
int second_tier[]={309 , 408 , 507 , 606 , 609 ,708 ,129 ,138 , 147 , 156 , 159 ,168 ,177 , 228 , 237 , 246 , 249 , 255 , 258 , 267 , 336 , 339 , 345 , 348 , 357 , 366 , 444 , 447 , 456 , 555};
int third_tier[]={209,308,407,506,709,808,119,128,137,146,155,169,178,227,236,245,259,268,277,335,344,349,358,367,448,457,466,556};
int fourth_tier[]={208,307,406,505,809,118,127,136,145,179,188,226,235,244,269,278,334,359,368,377,449,458,467,557,566};
int fifth_tier[]={900,108,207,306,405,909,117,126,135,144,189,225,234,279,288,333,369,378,459,468,477,558,567,666};
int sixth_tier[]={800,107,206,305,404,116,125,134,199,224,233,289,379,388,469,478,559,568,577,667};
int seventh_tier[]={700,106,205,304,115,124,133,223,299,389,479,488,569,578,668,677};
int eighth_tier[]={600,105,204,303,114,123,222,399,489,579,588,669,678,777};
int ninth_tier[]={500,104,203,113,122,499,589,679,688,778};
int tenth_tier[]={400,103,202,112,599,689,779,788};
int eleventh_tier[]={300,102,111,699,789,888};
int twelve_tier[]={200,101,799,889};
int thirteenth_tier[]={100,899,999};
//numbers to be found in the above arrays.
int previous_pick_3_numbers[]{346,794,861,529,347,925,196,969,243,837,740,025,822,809,454,843942,510,573,346}
return 0;
}
i want to create a program that will have an arraycalled array1[] of 30 sets of 3 one digit numbers i.e 804, 450,430 etc)
i will have 13 vector containersor arrays defined with a series of 3 one digit numbers. i want the program to find any series of numbers that is array1[] in any of the 13 vectors. and it will tell me in which vector the series was found in
also the order of the number shouldn't matter for example vector<int> first_tier (324)
the program should compare the values of one vector to an other vector for reoccuring series and it finds it in first_tier because 3 so which function do i use to do this. this is what i got so far
#include <iostream>
#include <algorithm>
using namespace std;
int * p; // points to array element
int main()
{
int First_tier[]={409 , 508 , 509, 607, 608 ,707 , 139 , 148 , 149 , 157 , 158 ,166 , 167 ,229 , 238 , 239 ,247 , 248 ,256 ,257 ,266 ,337 ,338 ,346 ,347 , 355 , 356 , 445 , 446 ,455};
int second_tier[]={309 , 408 , 507 , 606 , 609 ,708 ,129 ,138 , 147 , 156 , 159 ,168 ,177 , 228 , 237 , 246 , 249 , 255 , 258 , 267 , 336 , 339 , 345 , 348 , 357 , 366 , 444 , 447 , 456 , 555};
int third_tier[]={209,308,407,506,709,808,119,128,137,146,155,169,178,227,236,245,259,268,277,335,344,349,358,367,448,457,466,556};
int fourth_tier[]={208,307,406,505,809,118,127,136,145,179,188,226,235,244,269,278,334,359,368,377,449,458,467,557,566};
int fifth_tier[]={900,108,207,306,405,909,117,126,135,144,189,225,234,279,288,333,369,378,459,468,477,558,567,666};
int sixth_tier[]={800,107,206,305,404,116,125,134,199,224,233,289,379,388,469,478,559,568,577,667};
int seventh_tier[]={700,106,205,304,115,124,133,223,299,389,479,488,569,578,668,677};
int eighth_tier[]={600,105,204,303,114,123,222,399,489,579,588,669,678,777};
int ninth_tier[]={500,104,203,113,122,499,589,679,688,778};
int tenth_tier[]={400,103,202,112,599,689,779,788};
int eleventh_tier[]={300,102,111,699,789,888};
int twelve_tier[]={200,101,799,889};
int thirteenth_tier[]={100,899,999};
//numbers to be found in the above arrays.
int previous_pick_3_numbers[]{346,794,861,529,347,925,196,969,243,837,740,025,822,809,454,843942,510,573,346}
return 0;
}