Skip to main content
3 of 5
added 8 characters in body
Cabbie407
  • 1.3k
  • 10
  • 19
  • If there is no input and you use the BEGIN block, you can try to use the END block instead. Depending on the judge it works.

  • You can swap two numbers in a single command

    t=a;a=b;b=t

becomes

`a+=b-(b=a)`

saving one character

  • If you don't need them as input anymore, you can use the input variables $1, $2, $3, ... as an array. So instead of writing a[n] you can just write $n. Sometimes even while reading the input from these you can use the already handled ones as a stack for something.

If I can think of more, I'll edit

Cabbie407
  • 1.3k
  • 10
  • 19