Home > database >  Randomly generated addition and subtraction
Randomly generated addition and subtraction

Time:10-02

The cell reference function=blend (20), "20" refers to the addition and subtraction within 20

The Function blend (X)

Do

A=Int (Rnd (1) * X + 1)

B=Int (Rnd (1) * X + 1)

K=IIf ((Int (Rnd (1) * X + 1) Mod 2)=0, "+", "-")

If k="-" And a & gt; B, Then Exit the Do

If k="+" Then Exit the Do

Loop

Blend=Format (a, "@ @") & amp; K & amp; The Format (b, "@ @") & amp; "=__
"
End the Function

CodePudding user response:

Advice note sent to a personal blog, thank you
  • Related