Re: Addition of same value



Rita wrote:
> Hi Members ,

What about those in this NG without a member?

> I have some values like
> 120.00 14.85
> 125.00 12.53
> 125.00 10.576
> 125.00 15.326
> 127.00 18.245
> 127.00 5.243
> 129.00 10.253
> 132.00 15.02
> 135.00 12.356
> 135.00 12.34
> 135.00 14.35
> 137.00 11.21
> . .
> . .
> . .
> I want to make programm Which find all the same values from left side
> and do addition of that value of right side.
> Like i had 3 times 125.00 so i want output 12.53+10.576+15.326

Simple. Whenever you hear "same" then a hash is a likely candidate for a
solution.

Just use the left number as a key and as you walk through the values add the
right number to the value.

> So what will be code for it?

What do you have so far?

jue


.



Relevant Pages

  • Re: Addition of same value
    ... Rita wrote: ... > Hi Members, ... > I want to make programm Which find all the same values from left side ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: How I can store some value in loop?
    ... Rita wrote: ... > response i already tried it .may be my programm is not as good as you ... > just for this problam. ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: WHOS UP?...QUICK QUESTION?
    ... Just as we were about to find out who the three RMAS ... members are that support terrorist beheadings... ... Prev by Date: ...
    (rec.music.artists.springsteen)
  • Re: And Now For Something Completely Different...
    ... > Members of the Delphi Community, ... Prev by Date: ...
    (borland.public.delphi.non-technical)
  • OT: The Bus Tragedy Gets Personal
    ... The bus accident that killed a number of seniors evacuating from our area in ... front of Rita was tragic enough. ... Yesterday I learned that 2 members of my ...
    (rec.music.makers.guitar.acoustic)