Skip to content

Instantly share code, notes, and snippets.

@sugyan
Created May 27, 2015 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugyan/a6ef5715800578e9bab6 to your computer and use it in GitHub Desktop.
Save sugyan/a6ef5715800578e9bab6 to your computer and use it in GitHub Desktop.
$ for s in $(echo 1 | sed -E "s/(.*)/\1+2\n\1-2\n\12/" | sed -E "s/(.*)/\1+3\n\1-3\n\13/" | sed -E "s/(.*)/\1+4\n\1-4\n\14/" | sed -E "s/(.*)/\1+5\n\1-5\n\15/" | sed -E "s/(.*)/\1+6\n\1-6\n\16/" | sed -E "s/(.*)/\1+7\n\1-7\n\17/" | sed -E "s/(.*)/\1+8\n\1-8\n\18/" | sed -E "s/(.*)/\1+9\n\1-9\n\19/"); do echo $s | bc | grep -q ^100 && echo $s; done
1+2+3-4+5+6+78+9
1+2+34-5+67-8+9
1+23-4+5+6+78-9
1+23-4+56+7+8+9
12+3+4+5-6-7+89
12+3-4+5+67+8+9
12-3-4+5-6+7+89
123+4-5+67-89
123+45-67+8-9
123-4-5-6-7+8-9
123-45-67+89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment