HI;
(using C++) I would like to count how many times a number is used in a column.
example:
23 45 67
45 67 89
23 45 67
in the first column 23=2 45=1. second column 45=2 67=1. 3rd column 67=2 89=1.
my file is much larger but the above is what I am trying to get.
this is something that I am trying on my own.
thanks
so much
happy
First load the file into a 2D matrix. Then all you need to do is build a stereogram (a frequency graph) for each of the "columns". An std::map<int,int> is probably the best solution.
Considering the matrix as a 2 D array all you would need to do is compare i[0]j[0] with i[1]j[0].....i[n][j[0] for a match and increment j0count++. Move down 1 row to i[1]j[0] and repeat until uou get to i[n/2]j[0].repeat for the next column using j1count++ etc.
thank you helios
thank you buffbill
thank you roodtree
I got stuck. I am able to pull the numbers from the infile but couldn't get them to show how many times used.
This is great thank you for your help
thanks
happy