Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding puzzle (4)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00665368
Message ID:
00665526
Vues:
21
Einar:

>>>>>>>>>>
Here is one solution (I think) with only one loop and I am also using the < pre > tags for the first time ;)
for i = 1 to alen(myarray)
  if ascan(myarray, X - myarray(i)) > 0
    return myarray(i), myarray(ascan(myarray, X - myarray(i)))
  endi
next i
>>>>>>>>>>

No cigar again. ASCAN traverses (loops through) the array to locate the desired element so your solution still involves a double loop.

Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform