samedi 25 avril 2015

Perform Distribution on a input string containing an X (Basic Math)


I am getting an input string that could look like one of the following:

  • 2(6x-1)
  • 3x + 4(8-x)

I want to do this respectively

  • 12x-2
  • 3x+32-4x

How can I do this in Perl without using pre-made modules? I can't use eval() because of the X


Aucun commentaire:

Enregistrer un commentaire