|
Отправлено: 15.06.14 10:21. Заголовок: 3 array column comparing and split
int a[]={1,2 ,3,4, 1,1, 6,3 , 1,5,8}; int b[]={2,3 ,8,5, 1,1, 6,3 , 2,6,2}; int c[]={3,7 ,1,2, 2,3, 6,3 , 3,6,1}; i like to split array if column 's are matching high value , mid value , low value based for example you can see my array first column value a[0] = 1 b[0] = 2 c[0] = 3 first i need to find high value , mid value , low value to do that compare them each other so in this case you can see a[0] = 1 is Low value b[0] = 2 is the mid value c[0] = 3 is the high value then find next column high value , mid value , Low value and compare matching . in this case a[0] = {1} low value , a[1] = {2} low value b[0] = {2} mid value , b[1] = {3} mid value c[0] = {3} high value , c[1] = {7} high value all value are matching . incremented array again find the High , Mid, Low values and so on ... output i needed split - 1 1 , 2 2 , 3 3 , 7 split - 2 3 , 4 8 , 5 1 , 2 split - 3 1 , 1 1 , 1 2 , 3 split - 4 6 , 3 6 , 3 6 , 3 split - 5 1,5,8 2,6,2 3,6,1 you can see the last (split -5) is the unmatched value group i did this code but is a bad code how can i do this in a good way
|