Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: find and replace a value between two arrays
Replies: 1   Last Post: Jan 10, 2012 9:06 PM

 Messages: [ Previous | Next ]
 Rune Allnor Posts: 4,455 Registered: 12/7/04
Re: find and replace a value between two arrays
Posted: Jan 10, 2012 9:06 PM

On 11 Jan, 02:27, "george ts" <qwerty6...@yahoo.gr> wrote:
> Hi,
> I have two arrays.
> The first is like this : A=[1,0;1,0;1,0;2,0;2,0;3,0;3,0;3,0;3,0]
> The second is like this B=[1,'M';2,'F';3,'M';4,'F']
>  The problem i have is to make an algorithm : to replace in A array the "0"
>                                                                               with 'M' when its 1
>                                                                               with 'F' when its 2
>                                                                                with M when its 3
> And if there isn't the value in A array to find next such as 4,'F', that there isn't in A array
>
> PS: this is an example..I have thousands of values in the arrays

Homework?

doc find

Rune

Date Subject Author
1/10/12 george
1/10/12 Rune Allnor