text:
Brainflak Multiplication Metagolf

This question is the first of several Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday! You can find more information about Brain-Flak's Birthday here

Last summer we had the Brain-flak Integer Metagolf, and the answers it generated have been very useful to the Brain-Flak community since.  The main thing that makes the Integer Metagolf so efficient is a technique called Multiplication hardcoding.
In Brain-Flak runtime multiplication is extremely expensive.  The shortest known multiplication snippet is:
({}<>)({<({}[()])><>({})<>}{}<><{}>)

Discovered by Megatom
However there is a very simple way to create compile time multiplication.  For example the following code will multiply by 5:
 (({})({})({})({}){})

Try it online!
This works because consecutive expressions are added together. Each ({}) does nothing to the stack ({} pops and (..) pushes it right back) and evaluates to whatever is on top of the stack.  All these expressions together sum up to five times whatever was on the top of the stack.
For any n the following string expression will make a snippet that will multiply the top of the stack by n:
"("+"({})"*(n-1)+"{})"

This works by making n expressions that all evaluate to the top of the stack.  The first n-1 don't actually change anything and the last one removes the top of the stack before the push.
For composite numbers you can chain multiple smaller expressions together to save bytes.  For example you can multiply by 25 by multiplying by 5 twice:
(({})({})({})({}){})(({})({})({})({}){})

This is pretty simple, and for some numbers it works pretty well however there are better ways to do this.  For example one method I came up with uses the binary representation of the number. (Here is a python implementation)  This new method is much more effective than the simple string expression shown earlier, but its not the end, there are all sorts of interesting ways to hardcode multiplication and probably a ton that no one has yet discovered.
So I think it is time to see how good we can get.
Brief Overview of Brain-Flak
Here is a description of everything you will need to know about Brain-Flak for this challenge.
Brain-Flak has "nilads" and "monads".  Nilads are parentheses that have nothing inside of them. Each nilad does a thing and returns a value.  For this challenge the two nilads we are concerned with are {} and <>.  {} pops the top of the active stack and returns its value. <> switches the active stack and the in active stack, so that the active stack becomes inactive and the inactive stack becomes active, it returns zero.
Monads are parentheses with stuff inside them.  They take a single argument, the sum of everything inside them, sometimes perform an action, and then return a value.  The three of these we are concerned with are (...), <...> and [...].  The most important monad for this challenge (...) takes the value of the inside and pushes it to the active stack.  It then returns the argument.  <...> and [...] are both "inert" monads, that is they do not perform any action but rather modify the value they are passed.  <...> always returns zero regardless of the argument passed. Meanwhile [...] always returns the argument times -1.

Sample programs with explanation
If you have never programmed in Brain-Flak it might be a good idea to look at some example programs using the operations described
({}{})

This adds the top two numbers on the stack.  Each {} pops a value off of the stack and (...) pushes their sum back.
({}[{}])

Similarly this subtracts the second item on the stack from the first.  Like before each {} pops a value but the [..] around the second one causes it to be added.  Once again the (...) pushes the sum.
({}<{}>)

This removes the second value on the stack keeping the top value intact.  It works just like the last two except the second value is silenced by the <...> so the push only pushes the first value back.
(({}))

This makes a second copy of the value on the top of the stack.  It does this by popping the top of the stack with {} getting its value, the first (..) then pushes it back evaluating to its value.  The second (...) takes the value returned by the first and pushes that to the stack as well. creating a second copy.
Task
Given an integer n create a stack-clean Brain-Flak snippet that multiplies the top of the current stack by n.
You are permitted to use the following Brain-Flak operations
(...) -> Push Monad, Pushes the result of its contents
<...> -> Zero Monad, Returns zero
[...] -> Negative Monad, Returns the opposite of its contents result
{}    -> Pop nilad, Pops the TOS and returns its value
<>    -> Switch nilad, Switches the active and inactive stack

The other operations are banned for the purpose of the challenge.
Scoring
Your score will be the cumulative lengths of all the programs from n=2 to n=10000.  Be sure to include a link to the output of your program for verification.

Out of interest, why are the 1 and loop operations banned?

@Neil The stack height operator is also banned.

@EriktheOutgolfer I'd already banned that one in the integer metagolf anyway.

@Neil I banned the loop because eventually multiplication is going to become push n and use MegaTom's multiplication algorithm, and then it is just about who has the best metagolfer.  I banned 1 because I couldn't think of anyway it could be useful without the loop.  I thought it would be better for newbies if there were as few unnecessary operations as possible.

Computer scientists are weird. They invent programming languages that are impossible to use, inherently anti-golf, and then challenge each other to write golfed code to solve simple problems in this language. Nothing is more esoteric than this.  +1 good sir.

Is there really any use for <...>, [...] and <>?

@qwerp-derp In this particular challenge, probably not. In writing general purpose brain-flak code, absolutely! <...> is useful for modifying values underneath the top of the stack, [...] is essential for decrementing values, and <> makes a lot of programs easier to write and shorter.

@Qwerp-Derp I looked into optimising the output of the linked Python program (current score 681950) and found a trivial saving of 4492 using [...], so it's a start.

Ruby, 669856
$answers = Hash.new{|hash,n|
  valid = []
  2.upto(n**0.5){|i|
    valid.push("("+hash[n/i]+")"+"({})"*(i-2)+"{}") if n%i == 0
  }
  valid.push("({})"+hash[n-1])
  (hash[n] = valid.min_by{|s| s.length})
}
$answers[1] = "{}"

def full_answer n
  "("+$answers[n]+")"
end

This is a quick baseline answer. First 1000 min-programs found here. (I tried posting all of them, but that overloaded the max pastebin size.) I may add a code explanation later.
Examples:
360:    ((((((({})(({}){}){})({}){})({}){}){}){}){})
4608:   (((((((((((({})({}){})({}){}){}){}){}){}){}){}){}){}){})
9991:   (({})((({})(((((((({})((({})({}){}){}){}){}){}){}){}){}){}){})({}){}){})


text:
Golf Dennis a thermometer
Dennis puts in a huge amount of effort for this community, including as moderator, language designer, and provider of TIO.
Unfortunately, his four-year-old daughter has caught a cold, so let us all help him keep track of her recovery (may it be speedy) by providing him with a thermometer:
.-----------.
|           |
|           |
'-.       .-'
.-'   -   '-.
|107.6- 42.0|
|106.7- 41.5|
|105.8- 41.0|
|104.9- 40.5|
|104.0- 40.0|
|103.1- 39.5|
|102.2- 39.0|
|101.3- 38.5|
|100.4- 38.0|
| 99.5- 37.5|
| 98.6- 37.0|
| 97.7- 36.5|
| 96.8- 36.0|
| 95.9- 35.5|
| 95.0- 35.0|
'---. - .---'
    | - |
    |---|
    |   |
    '---'

Since Dennis does not have much time to read code, you must keep yours as short as possible.

The shape reminds me more of a pregnancy test ._.

@carusocomputing Inspiration. But hey, maybe she doesn't have a cold, but is just pregnant? This could of course be good or bad…

@Adám is there anything you don't have a source for :P?

@carusocomputing That he puts in a huge amount of effort. Maybe all that he does is really easy for him. Did he ever mention it being hard?

I've found proof of Dennis busy with life chores, but google comes up empty for all this PPCG nonsense haha.

I dare you to add citations to every word in this post ;)

Aww, hope she gets well. Anyways, I'm giving a +100 bounty to who makes a functional thermometer! :P

@SIGSEGV I'm in.

@Adám O_o that includes sneaking in Dennis' house and secretly attaching a thermometer on his daughter :\

@SIGSEGV Try it online! -
Source

...Why isn't there Dennis:The language yet though?

@SIGSEGV it'd be a menace.

@SIGSEGV So Jelly?

@Nobody You should consider making "make a functional thermometer" a separate question. Depending on specs, it might be like 44 bytes in Mathematica...

Jelly, 90 89 84 83 82 bytes
-1 byte thanks to Erik the Outgolfer (replace 10 with ⁵)
15r1×€9,5+“£Ȧ“¡^’d⁵Dj€€”.j€⁾- Uz⁶ZUj@€⁾||
“¡ẹƭgụḌẊṘgYƊxyẓṡƝçƤ5ȥṭ’ṃ“.| '-”s7ŒBs5j¢Y

Try it online!
How?
15r1×€9,5+“£Ȧ“¡^’d⁵Dj€€”.j€⁾- Uz⁶ZUj@€⁾|| - Link 1, body: no arguments
15r1                                      - inclusive range(15,1)      = [15,14,...,2,1]
      9,5                                 - pair nine with five        = [9,5]
    ×€                                    - multiply for €ach          = [[135,75],[126,70],...,[18,10],[9,5]]
          “£Ȧ“¡^’                         - list of base 250 numbers   = [941,345]
         +                                - addition                   = [[1076,420],[1067,415],...,[959,355],[950,350]]
                 d⁵                       - div&mod 10                 = [[[107,6],[42,0]],[[106,7],[41,5]],...,[[95,9],[35,5]],[[95,0],[35,0]]]
                   D                      - convert to decimal lists   = [[[[1,0,7],6],[[4,2],0]],[[[1,0,6],7],[[4,1],5]],...,[[[9,5],9],[[3,5],5]],[[[9,5],0],[[3,5],0]]]
                       ”.                 - literal '.'
                    j€€                   - join €ach for €ach         = [[[1,0,7,'.',6],[4,2,'.',0]],[[1,0,6,'.',7],[4,1,'.',5]],...,[[9,5,'.',9],[3,5,'.',5]],[[9,5,'.',0],[3,5,'.',0]]]
                           ⁾- <space      - literal ['-',' ']
                         j€               - join €ach                  = [[1,0,7,'.',6,'-',' ',4,2,'.',0],[1,0,6,'.',7,'-',' ',4,1,'.',5],...,[9,5,'.',9,'-',' ',3,5,'.',5],[9,5,'.',0,'-',' ',3,5,'.',0]]
                              U           - upend (reverse each)       = [[0,'.',2,4,' ','-',6,'.',7,0,1],[5,'.',1,4,' ','-',7,'.',6,0,1],...,[0,'.',5,3,' ','-',9,'.',5,9],[0,'.',5,3,' ','-',0,'.',5,9]]
                               z⁶         - transpose space filler     = [[0,5,...,5,0],['.','.',...,'.','.'],[2,1,...,5,5],[4,4,...,3,3],[' ',' ',...,' ',' '],['-','-',...,'-','-'],[6,7,...,9,0],['.','.',...'.','.'],[7,6,...,5,5],[0,0,...,9,9],[1,1,...,' ',' ']]
                                 Z        - transpose                  = [[0,'.',2,4,' ','-',6,'.',7,0,1],[5,'.',1,4,' ','-',7,'.',6,0,1],...,[5,'.',5,3,' ','-',9,'.',5,9,' '],[0,'.',5,3,' ','-',0,'.',5,9,' ']]
                                  U       - upend                      = [[1,0,7,'.',6,'-',' ',4,2,'.',0],[1,0,6,'.',7,'-',' ',4,1,'.',5],...,[' ',9,5,'.',9,'-',' ',3,5,'.',5],[' ',9,5,'.',0,'-',' ',3,5,'.',0]]
                                      ⁾|| - literal ['|','|']
                                   j@€    - join €ach (reversed @rgs)  = [['|',1,0,7,'.',6,'-',' ',4,2,'.',0,'|'],['|',1,0,6,'.',7,'-',' ',4,1,'.',5,'|'],...,['|',' ',9,5,'.',9,'-',' ',3,5,'.',5,'|'],['|',' ',9,5,'.',0,'-',' ',3,5,'.',0,'|']]
                                          -                  effectively ["|107.6- 42.0|","|106.7- 41.5|","|105.8- 41.0|","|104.9- 40.5|","|104.0- 40.0|","|103.1- 39.5|","|102.2- 39.0|","|101.3- 38.5|","|100.4- 38.0|","| 99.5- 37.5|","| 98.6- 37.0|","| 97.7- 36.5|","| 96.8- 36.0|","| 95.9- 35.5|","| 95.0- 35.0|"]

“¡ẹƭgụḌẊṘgYƊxyẓṡƝçƤ5ȥṭ’ṃ“.| '-”s7ŒBs5j¢Y - Main link: no arguments   (using "..." below to represent lists of characters)
“¡ẹƭgụḌẊṘgYƊxyẓṡƝçƤ5ȥṭ’                  - base 250 number     =  1694125525350532761476179586378844141697690917975
                        “.| '-”          - literal ['.','|',' ',"'",'-']
                       ṃ                 - base decompression  =  ".------|      |      '-.    .-'   -'---. -    | -    |--    |      '--"
                               s7        - split into 7s       =  [".------","|      ","|      ","'-.    ",".-'   -","'---. -","    | -","    |--","    |  ","    '--"]
                                 ŒB      - bounce (vectorises) =  [".-----------.","|           |","|           |","'-.       .-'",".-'   -   '-.","'---. - .---'","    | - |    ","    |---|    ","    |   |    ","    '---'    "]
                                   s5    - split into 5s       = [[".-----------.","|           |","|           |","'-.       .-'",".-'   -   '-."],["'---. - .---'","    | - |    ","    |---|    ","    |   |    ","    '---'    "]]
                                      ¢  - call last link (1) as a nilad
                                     j   - join                = (using "..." below to represent mixed-type lists from the result of ¢)
                                                               = [".-----------.","|           |","|           |","'-.       .-'",".-'   -   '-.","|107.6- 42.0|","|106.7- 41.5|","|105.8- 41.0|","|104.9- 40.5|","|104.0- 40.0|","|103.1- 39.5|","|102.2- 39.0|","|101.3- 38.5|","|100.4- 38.0|","| 99.5- 37.5|","| 98.6- 37.0|","| 97.7- 36.5|","| 96.8- 36.0|","| 95.9- 35.5|","| 95.0- 35.0|","'---. - .---'","    | - |    ","    |---|    ","    |   |    ","    '---'    "]
                                       Y - join with newlines  = :
                                                                 .-----------.
                                                                 |           |
                                                                 |           |
                                                                 '-.       .-'
                                                                 .-'   -   '-.
                                                                 |107.6- 42.0|
                                                                 |106.7- 41.5|
                                                                 |105.8- 41.0|
                                                                 |104.9- 40.5|
                                                                 |104.0- 40.0|
                                                                 |103.1- 39.5|
                                                                 |102.2- 39.0|
                                                                 |101.3- 38.5|
                                                                 |100.4- 38.0|
                                                                 | 99.5- 37.5|
                                                                 | 98.6- 37.0|
                                                                 | 97.7- 36.5|
                                                                 | 96.8- 36.0|
                                                                 | 95.9- 35.5|
                                                                 | 95.0- 35.0|
                                                                 '---. - .---'
                                                                     | - |
                                                                     |---|
                                                                     |   |
                                                                     '---'

Batch, 325 bytes
@echo off
for %%l in ("|           |" "|           |" "'-.       .-'" ".-'   -   '-.")do echo %%~l
set/ac=42,d=5
for /l %%f in (1076,-9,950)do call:c %%f
for %%l in ("'---. - .---'" "    | - |" "    |---|" "    |   |" "    '---'")do echo %%~l
exit/b
:c
set f= %1
set/ac-=!d,d=5-d
echo ^|%f:~-4,-1%.%f:~-1%- %c%.%d%^|

SOGL, 98 97 bytes
▼⅜¦┌Υ   υl←│Γφγ⅔3wο╚°⁸ofč√&@⁶‘O’⁴∫ |O:9L/*’a6L/+;-l4=?@o}oƧ- o12/*’ ;-o |o"ģ⌠℮Ζ║Kgš‰¶¶ksθ○╤Ƨ%←└⅟ΟS‘

note: the 3 spaces close to the beggining of the program are a tab
Explanation:
...‘O                                                  output the beginning part
     ’⁴∫                                               repeat 15 times, pushing (0-indexed iteration)
         |O                                            output in a new line "|"
           :                                           duplicate the iteration
            9L/                                        push 0.9 (9/10)
               *                                       multiply [0.9 and the iteration]
                ’a6L/+                                 push 107.6 (107+6/10)
                      ;-                               reverse subtract (107.6 - 0.9*iteration)
                        l4=?  }                        if length is 4
                            @o                           output a space
                               o                       output the number
                                Ƨ- o                   output "- "
                                    12/                push 0.5 (1/2)
                                       *               multiply that by iteration
                                        ’              push 42
                                          ;-           reverse subtract (42-0.5*iteration)
                                            o          output that
                                              |o       output "|"
                                                "...‘  push the ending part

To save one byte, I made it push the ending string every time in the loop just so it could get outputted once.

Dennis wants you to add a way to try it online so he doesn't have to spend time away from his daughter figuring out where to find a SOGL compiler.

SOGL never ceases to impress me with its compression

@owlswipe While SOGL is in heavy development (for example, soon I'm gonna release a version that breaks all programs with functions or compression (I hope it's gonna be the last time)) trying stuff online will not be a priority

@dzaima I didn't realize you personally made SOGL! That is SO cool, very much forgiven for not having a compiler :))

V, 113 bytes
i|1076- 420|14ñÙ9l5ñÎeé.$hé.
ç|9/á
o'³-. - .³-'
| - |
|³-|
|³ |
'³-'4>3kHO.±±-.
|±± |Ùo'-.· .-'
.-'³ -³ '-.

Try it online!
Hexdump:
00000000: 697c 3130 3736 2d20 3432 307c 1b31 34f1  i|1076- 420|.14.
00000010: d939 186c 3518 f1ce 65e9 2e24 68e9 2e0a  .9.l5...e..$h...
00000020: e77c 392f e120 0a6f 27b3 2d2e 202d 202e  .|9/. .o'.-. - .
00000030: b32d 270a 7c20 2d20 7c0a 7cb3 2d7c 0a7c  .-'.| - |.|.-|.|
00000040: b320 7c0a 27b3 2d27 1b34 3e33 6b48 4f2e  . |.'.-'.4>3kHO.
00000050: b1b1 2d2e 0a7c b1b1 207c 1bd9 6f27 2d2e  ..-..|.. |..o'-.
00000060: b720 2e2d 270a 2e2d 27b3 202d b320 272d  . .-'..-'. -. '-
00000070: 2e                                       .

More golfing on the way!

Dennis doesn't understand how the hell that code works, but appreciate that it works very well in very few bytes.

@owlswipe I doubt it. We're talking about Dennis here; he knows how everything works. ;p

@KevinCruijssen Maybe :)). I have no clue how this works though!

@owlswipe Me neither, so I agree it could use an explanation. :)

PHP, 187 Bytes
storing 4 spaces in a variable saves 7 Bytes

<?=".-----------.
|",$f="    ","$f   |
|$f$f   |
'-.$f   .-'
.-'   -   '-.
";for($n=85;--$n>69;)printf("|%5.1f-%5.1f|
",$n*.9+32,$n/2);echo"'---. - .---'
$f| - |
$f|---|
$f|   |
$f'---'";

Try it online!
PHP, 188 Bytes
<?$s=".000--.
|1223|1223'-.12.-'
.-'1-1'-.
4";for($n=85;--$n>69;)$t.=sprintf("|%5.1f-%5.1f|
",$n*.9+32,$n/2);$s.="'0. - .0'
2| - 32|032|132'0'";echo strtr($s,["---","   ","    ","|
",$t]);

Try it online!
PHP, 220 Bytes
<?=gzinflate(base64_decode("XZBJCkUhDAT3niI7VzbOw908/O/EwIMviCnLQBukbyFc+db9o5jgNVIM3KwSd9S+khdmkl6Rr9LEIhUMo4Ft9FzHIWV3HdnouYaSpB13FdXouYJG2u4yupE6OewgLXNytmYhPbc0S5vupmYhPTc0SxvuhmYhZf0t58H/gWcMNgHSfRXvvLLJiE2B734="));

Try it online!
PHP, 247 Bytes
<?=bzdecompress(base64_decode("QlpoNDFBWSZTWREU1+kAAEnYgEiQQIN/4AAEMAC6bDTRA1NBtqglJ7VIA0AJNSEAAXhknxmxdEkbQhoFWMYrEL1cASWoMYgwHEpJJJKZmZ638CwPCeQHBCLKs3qj1vvz37lF4trWtWviLC4wJoHJywEMA8GmAh2WwUSEom/JeNAioiokhJa9V5bL02pVVVXw+EiwPxdyRThQkBEU1+k="));

Try it online!

Python 2, 163 bytes
i=89
for x in("------.x|x|x.-'x-   '-."+"x"*16+"- .---'x- |x--|x  |x--'").split('x'):y='%%-77ss'[i>80::2]%x;print['|%5s- %s|'%(32+.9*i,i/2.),y[:0:-1]+y][x>''];i-=1

Try it online!

I’m late to this party, but y='%*s'%(i/80*14-7,x) saves a byte.

APL (Dyalog), 144 143 bytesSBCS
m←⊢,1↓⌽
1⌽'.||',⍣2⊢11/⍪3↑d←'-'
m 7↑a←∪∊z←⊂'''---. -'
m(6↑⌽a),d
⊃{'|',⍵,'-',⍺,'|'}/(5 1⍕⍪)¨35 95+↓.5 .9∘.×⌽⍳15
↑m¨z,¯7↑¨'| -' '|--' '|  ' '''--'

Try it online!

///, 261 bytes
/`/\/\///i/|
|`~/---`_/   `+/- `f/.5`z/.0`(/i10`)/i 9`!/|
    |/
.--~~~.
|  ___i  ___|
'-. __.-'
.-'_-_'-.
|107.6+42z(6.7+41f(5.8+41z(4.9+40f(4.0+40z(3.1+39f(2.2+39z(1.3+38f(0.4+38z)9f+37f)8.6+37z)7.7+36f)6.8+36z)5.9+35f)5.0+35z|
'~. - .~'
    | - !~!_|
    '~'

Try it online!
Works by using common occurrences like --- as replacements. Nothing fancy.

JavaScript (ES8),  198 193  189 bytes
Number formatting is a bit costly in JS and I seem to be stuck at this byte count. You win this time, PHP! ;-)
_=>`.111--.
|67|
|67|
'-.8.-'
.-'4-4'-.
${9e14}'1. - .1'
5| - |
5|1|
5|4|
5'1'`.replace(/\d/g,n=>n%9?''.padEnd(n-1)||'---':`|${F(32+.9*i)}-${F(i--/2)}|
`,i=84,F=v=>v.toFixed(1).padStart(5))

Try it online!

I hope that you are not angry about that I could save 8 Bytes more. Thank You for the reminder to try a second approach with strtr

@JörgHülsermann No worries! :) Well done!

Japt, 106 bytes
[".{6î-}
|
'-.
.-'   -"y y 9"'
-
-
-
.|||'
  - -
--- -"y]·mê0R d9FÆ"|{S+(#k6-9*X)t4n)i.J}- {½*Xn84)x1}|"Ã·

Test it online!
Many thanks to @obarakon who got the code working in the first place, and did quite a bit of the golfing.
Explanation
First we have the data:
[                                     // Create an array of:
  ".{6î-}\n|\n'-.\n.-'   -"           //   This string ({6î-} inserts 6 hyphens),
  y y                                 //   transposed twice to pad it with spaces;
  9                                   //   the number 9;
  "'\n-\n-\n-\n.|||'\n  - -\n--- -"   //   and this string,
  y                                   //   transposed once.
]·                                    // Join the array with newlines.

This gives us
.------
|
'-.
.-'   -
9
'---. -
    | -
    |--
    |
    '--

That is, the left half of the thermometer, with the main rectangle replaced with a 9. Note that every line is padded with spaces except the one containing the 9.
m  R   // Map each line with the function
 ê     //   ê, or "bounce"; mirrors the string about its last character ("abc" -> "abcba").
       // (The 0 is just filler because `m` expects the `R` to be the third parameter)

The net effect is that it mirrors the left half of the thermometer to the right:
.-----------.
|           |
'-.       .-'
.-'   -   '-.
9
'---. - .---'
    | - |
    |---|
    |   |
    '---'

Now that we have the ASCII-art part, all we have to do is put in the main rectangle:
d9FÆ  "|{S+(#k 6-9*X)t4n)i.J}- {½ *Xn84)x1}|"Ã ·
d9FoX{"|{S+(1076-9*X)t4n)i.J}- {.5*Xn84)x1}|"} qR

  FoX{  ...  }        // Create the range [0...15), and map each item X to
"|{ ... }- { ... }"   //   this string, with the two blanks filled in with...

S+(1076-9*X)t4n)i.J
   1076-9*X           //   Calculate 1076 - 9*X. This gives us °F * 10.
S+(        )t4n)      //   Prepend a space and take only the last 4 chars.
                      //   This pads the entries under 100°F to the correct length.
                i.J   //   Insert a decimal point before the last char.
                      //   This turns e.g. "1076" to "107.6".

.5*Xn84)x1
   Xn84               //   Take 84 - X.
.5*    )              //   Multiply it by 0.5. This gives us °C.
        x1            //   Convert to a string with exactly 1 decimal point.

                qR    // Join the resulting array with newlines.
d9                    // In the thermometer art, replace "9" with the resulting string.

And that concludes our ASCII-art generating session. Tune in next week to see more kinda-short ASCII-art programs written in Japt!

Mathematica 247 Bytes
Hmmm... same as PHP
Uncompress@"1:eJxtkLsNAyEQRM+d4OgiRssf2rBTR27ADdCG+/WAODYxEkL7eKDR3N+fx/N7Ow5YXXiJ893o6n/BabFG2HMAHhws97n+cFKQrYke0hfIKAQO6QIJdYJtRDQCUSNCJthGgLMmNDU8/ATbcAgEVQ1BnGAZpvE1QbkM0+pISrCNMpKGrEYeSQm2kUbSkNRIIymBrILYJfsY3c6CZnUEfQ+80eEq1swG+eYH1XhZzA=="

Charcoal, 62 bytes
←⁶↓.↓²'-.¶.-'¶↓¹⁵'³↓.↓³'²Ｍ²↖¹↑×¹⁹-‖ＯＭ⁵¦¹⁶←Ｅ¹⁵⮌⁺⁺⁺⁹⁵×·⁹ι- ⁺³⁵⊘ι

Try it online! Link is to verbose version of code. Explanation:
←⁶↓.↓²'-.¶.-'¶↓¹⁵'³↓.↓³'²Ｍ²↖¹↑×¹⁹-

Print the left half of the thermometer.
‖Ｏ

Reflect it to complete the body.
Ｍ⁵¦¹⁶←Ｅ¹⁵⮌⁺⁺⁺⁹⁵×·⁹ι- ⁺³⁵⊘ι

Compute the scales and print them reversed and up-side down, which right-justifies them. At time of writing, Charcoal's concatenation operator converts floats to strings using Python's built-in str which appends .0 for floats that represent integers, otherwise I would have to resort to formatting, as its Cast operator specifically avoids that behaviour.

Since there's a pandemic out there, I thought the world could use one more thermometer:
Perl 5, 180 bytes
say$_=".-----------.
",y/.-/| /r x2,"'-.       .-'
.-'   -   '-.";map{printf"|%5.1f-%5.1f|
",32+$_*.9,$_/2}reverse 70..84;say"'---. - .---'
    | - |
    |---|
    |   |
    '---'"

Try it online!

C, 222 bytes
f(){puts(".-----------.\n|           |\n|           |\n'-.       .-'\n.-'   -   '-.");for(float n=108.5,m=42.5;m>35;printf("|%5.1f- %.1f|\n",n-=.9,m-=.5));puts("'---. - .---'\n    | - |\n    |---|\n    |   |\n    '---'");}

Despite attempting to shorten the string, hardcoding it in a plain format is the best option. I doubt that any (significant) improvement is possible in C.

The first string part can be shorten a bit (5 chars) by using : printf(".-----------.\n|%11s|\n|%11s|\n'-.%7s.-'\n.-'   -   '-.\n","","","");

vim, 222 keystrokes
:.!seq 42 -0.5 35
:%!awk '{printf("|\%5.1f- \%.1f|\n",1.8*$1+32,$1)}'
Go'===. - .==='<ESC>yy
:s/=/-/g
p
:.!tr "'.=" ' | '
:s/ *$/
yyP
:s/-/ /
ddpPlR---<ESC>yyGp
:s/|/'/g
ggO..<ESC>11i-<ESC>yyP
:.!tr .- '| '
yypo'-.<ESC>7a <ESC>a.-'<ENTER>.-'   -   '-.<ESC>

C (gcc), 234 217 212 210 bytes
f=420;main(){for(printf(".-----------.\n|%11s|\n|%1$11s|\n'-.%1$7s.-'\n.-'   -   '-.\n","");f>345;f-=5)printf("|%5.1f- %.1f|\n",32+f*.18,f*.1);puts("'---. - .---'\n    | - |\n    |---|\n    |   |\n    '---'");}

Try it online!
-15 bytes thanks to ceilingcat!!
-5 bytes thanks to TrapII!!
Output:
.-----------.
|           |
|           |
'-.       .-'
.-'   -   '-.
|107.6- 42.0|
|106.7- 41.5|
|105.8- 41.0|
|104.9- 40.5|
|104.0- 40.0|
|103.1- 39.5|
|102.2- 39.0|
|101.3- 38.5|
|100.4- 38.0|
| 99.5- 37.5|
| 98.6- 37.0|
| 97.7- 36.5|
| 96.8- 36.0|
| 95.9- 35.5|
| 95.0- 35.0|
'---. - .---'
    | - |
    |---|
    |   |
    '---'

Deadfish~, 2064 bytes
{iiii}iiiiiicd{c}cic{ddd}ddddddc{{i}}{i}iiiic{{d}i}dd{c}c{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}dd{c}c{{i}d}iic{{d}}{d}ddddc{iii}dciiiiiicic{d}ddddccccccc{i}iiiicdcddddddc{ddd}ic{iii}iiiiiicdcddddddc{d}iiiccc{i}iiic{d}dddccc{i}dddciiiiiicic{ddd}ddddddc{{i}}{i}iiiic{{d}iii}dddddcdc{i}dddc{d}ic{i}ddc{d}ic{d}dddc{ii}cddcddddciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdciiiiiic{d}iic{i}dc{d}c{d}dddc{ii}cdddcdddc{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdciiiiic{d}iiic{i}c{d}dc{d}dddc{ii}cdddcdddciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdciiiicddddddc{i}ic{d}ddc{d}dddc{ii}cddddcddc{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdciiiicddddddciicdddc{d}dddc{ii}cddddcddciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdciiicdddddciiicddddc{d}dddc{ii}dciiiiiic{d}dc{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdciicddddciiiicdddddc{d}dddc{ii}dciiiiiic{d}dciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdcicdddciiiiicddddddc{d}dddc{ii}dciiiiic{d}c{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}iii}dddddcdccddciiiiiic{d}iiic{d}dddc{ii}dciiiiic{d}ciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{ii}iiiiicc{d}dc{i}dddc{d}iic{d}dddc{ii}dciiiic{d}ic{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{ii}iiiiicdc{d}c{i}ddc{d}ic{d}dddc{ii}dciiiic{d}iciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{ii}iiiiicddc{d}ic{i}dc{d}c{d}dddc{ii}dciiic{d}iic{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{ii}iiiiicdddc{d}iic{i}c{d}dc{d}dddc{ii}dciiic{d}iiciic{{i}ddd}iiiiiic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{ii}iiiiicddddc{d}iiic{i}ic{d}ddc{d}dddc{ii}dciic{d}iiic{i}dddc{{i}ddd}ic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{ii}iiiiicddddc{d}iiiciicdddc{d}dddc{ii}dciic{d}iiiciic{{i}ddd}iiiiiic{{d}}{d}ddddc{iii}dciiiiiicccic{d}ddddc{i}iiic{d}dddc{i}iiiicdcccddddddc{ddd}ic{ii}iicccc{{i}d}iic{{d}i}ddc{i}iiic{d}dddc{{i}d}iic{{d}}{d}ddddc{ii}iicccc{{i}d}iic{{d}ii}iccc{{i}dd}dc{{d}}{d}ddddc{ii}iicccc{{i}d}iic{{d}i}ddccc{{i}d}iic{{d}}{d}ddddc{ii}iicccc{i}dddciiiiiicccddddddc

Sorry Dennis.

Go, 238 bytes
Wow, that string is really resistant to golfing...
package main
import."fmt"
func main(){p:=Printf
s,i:=`|           |
`,42.
p(`.-----------.
`+s+s+`'-.       .-'
.-'   -   '-.
`)
for;i>=35;i-=.5{
p(`|%5.1f- %.1f|
`,i*9/5+32,i)}
p(`'---. - .---'
    | - |
    |---|
    |   |
    '---'`)}

Try live here: https://play.golang.org/p/tPKYxII7NC

C, 460 265 bytes
#define P(x) puts(x);
#define Z "|           |"
T(){float i=7,j=12.6;P(".-----------.")P(Z)P(Z)P("'-.       .-'")P(".-'   -   '-.")while(i>=0)printf("|%5.1f- %.1f|\n",95+j,35+i),i-=.5,j-=.9;P("'---. - .---'")P("    | - |")P("    |---|")P("    |   |")P("    '---'")}

Output Live
.-----------.
|           |
|           |
'-.       .-'
.-'   -   '-.
|107.6- 42.0|
|106.7- 41.5|
|105.8- 41.0|
|104.9- 40.5|
|104.0- 40.0|
|103.1- 39.5|
|102.2- 39.0|
|101.3- 38.5|
|100.4- 38.0|
| 99.5- 37.5|
| 98.6- 37.0|
| 97.7- 36.5|
| 96.8- 36.0|
| 95.9- 35.5|
| 95.0- 35.0|
'---. - .---'
    | - |
    |---|
    |   |
    '---'

This doesn't look very golfed. Can't you e.g. combine the two identical lines? Also, you have a leading space on all lines

@Adám golfed now.

Maybe you can define the four spaces and reuse them? For-loop with math for all the numbers?

@Adám thx, golfed further now.

You're missing the lowest temperatures: 95.0- 35.0

@Adám shows the lowest temps now.

222 bytes

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Translate numbers to French
The French spell out numbers in a peculiar way.

1-16 are "normal"
17-19 are spelled out 10+7. 10+8, 10+9.
20-69 are "normal" (OK, OK! Not really, but they are in this challenge)
70-79 are 60+10, 60+11 ... 60+10+7, 60+10+8, 60+10+9.
80-99 are 4*20, 4*20+1, 4*20+2 ... 4*20+16, 4*20+10+7, 4*20+10+8, 4*20+10+9

Challenge:
Take a positive integer in the range [1,100], and output it the "French way". You must output it exactly as it's shown below, with * and +, so 97 is 4*20+10+7, not [4 20 10 7] or something else.
Test cases:
1  - 1
.. - ..
16 - 16
17 - 10+7
18 - 10+8
19 - 10+9
20 - 20
21 - 21
.. - ..
69 - 69
70 - 60+10
71 - 60+11
72 - 60+12
77 - 60+10+7
78 - 60+10+8
79 - 60+10+9
80 - 4*20
81 - 4*20+1
82 - 4*20+2
.. - ..
90 - 4*20+10
91 - 4*20+11
96 - 4*20+16
97 - 4*20+10+7
98 - 4*20+10+8
99 - 4*20+10+9
100 - 100

Every language I know has a transition in the "teens", like the one from 16 to 10+7 above. (In English it happens between 12 and 10+3, with a little more morphological disguise.) I've always been a little overobsessed with the fact that different languages make that transition at different numbers.

Why should "vingt-deux" be 22 when "dix-huit" is 10+8?

@GregMartin Intriguing, I agree. Even the Romance languages do it at different numbers, oddly! (Spanish at 16, Italian and French at 17, albeit with different morphologies, and Latin not at all.)

Luckily, this is a programming puzzle site and not a linguistic trivia site. Otherwise people might get annoyed when OP makes silly mistakes. Phew!

@StewieGriffin People still got annoyed.

And strictly speaking, although not obviously so, 11 is 1+10 (onze < undecim), 12 is 2+10 (douze < duodecim), 13 is 3+10 (treize < tredecim), 14 is 4+10 (quatorze < quattuordecim), 15 is 5+10 (quinze < quindecim), and 16 is 6+10 (seize < sedecim).

As a french I do find it quite fine :D.

As a French speaking Swiss, that disturbs me a bit (for me: soixante-dix = septante, quatre-vingts = huitante, quatre-vingt-dix = nonante). Your challenge would be so much less challenging, though.

A curious fact is the language of love stops at 69!

Excel, 153 149 Bytes
=IF(OR(A1<17,A1>99,AND(A1>19,A1<70)),A1,IF(A1<20,"10+"&A1-10,IF(A1<80,"60","4*20")&IF(A1=80,,IF(MOD(A1,20)>16,"+10+"&MOD(A1,20)-10,"+"&MOD(A1,20)))))

I'm sure this could be better, I struggled to find an efficient way to account for #80.
edit: Consolidated the 'Normal' cases better to save 4 bytes.  #80 still sucks.
Can't find a specific answer on here, not sure the rules of code-golf tbh.  Can I use multiple cells in Excel, and add the byte count of each?
ie. For an input in cell A1
A2: 11 Bytes
=MOD(A1,20)

A3 (result): 125 Bytes
=IF(OR(A1<17,A1>99,AND(A1>19,A1<70)),A1,IF(A1<20,"10+"&A1-10,IF(A1<80,"60","4*20")&IF(A1=80,,IF(A2>16,"+10+"&A2-10,"+"&A2))))

For a total of 136?

I think it should be allowed to write code in multiple cells. IMHO it's like having intermediate variables or functions in other programming languages.

I feel that there should be some penalty of using multiple cells, just like there's a penalty of using functions in other languages (that of typing the boilerplate to declare the function). Perhaps the tersest supported encoding (ie CSV), so the necessary number of commas and (if required) quotes?

I'm not aware of any format that excel files can be saved in with a recognizable output.  CSV files do not by default support functions like these, and will break up any function that uses a comma.  If saved as pure text in one column with a new line between cells, it could be copied directly into excel and function.  In this case, 1 byte would be added for each additional cell.

Save a byte by converting IF(A1=80,,IF(MOD(A1,20)>16,"+10+"&MOD(A1,20)-10,"+"&MOD(A1,20))) to IFS(A1=80,,MOD(A1,20)>16,"+10+"&MOD(A1,20)-10,1,"+"&MOD(A1,20))

In Libreoffice calc, you can skip the ) at the end, can you do the same in excel? So you can save 5 "bytes" (there are really UCS2-Chars, so if you say Byte == octet, you must count it double). And you must change the , in ;

@12431234123412341234123 No, but you can delete all the trailing parentheses and Excel autocorrects for you. I'm guessing that doesn't count

@Greedo For curiosity, i create a Open document spreadsheet file with LO, have a formula with the closing  parentheses in it and save it. After that i edit this file manual and remove the closing parentheses ), LO can open this file again without a problem (and add the missing parentheses automatic). So maybe you can say, you do not count the ) (i don't know, what make more sense), but the formula in the file is longer because of the escaped < and >

@qoou, create a CSV document, first line input, lines 2 & 3 as above, surrounded by ".  = 152 bytes.

Retina, 52 48 bytes
4 bytes saved thanks to Neil
^7\B
60+1
^9\B
81
^8\B
4*20+
1(?=7|8|9)
10+
\+0

Try it online! or verify all inputs (provided by Neil)
Explanation
^7\B
60+1
^9\B
81
^8\B
4*20+

First we handle the translation of 70, 80, and 90. In these first 3 stages, a 7 at the start with another character following it is replaced by 60+1. Similarly, 9 is replaced by 81, and 8 by 4*20+1. The replacement of 9 is essentially changing it to "eighty-ten" and such, so that the 8 is then handled by the next replacement, which saves bytes over writing 4*20+1 twice.
1(?=7|8|9)
10+

This handles the cases of 17, 18, and 19, by replacing the 1 in each with 10+.
\+0

Finally, there should never be a +0 at the end, so delete it if it's there.

Surely instead if look behinds and lookaheads you can use capture groups

Doesn't work for 7-9, but I don't think you need that lookbehind: Try it online!

@Neil I realized that while I was gone :P But thanks for the new version!

@Downgoat I could replace the lookahead with a capturing group but it wouldn't save any bytes since $1 is just as long as ?=.

Python 2, 98 bytes
f=lambda x:[`x`*(x%100<70),'10+'+`x-10`][16<x<20]or['60+'+f(x-60),'4*20'+x/81*('+'+f(x-80))][x/80]

Try it online!

JavaScript (ES6), 73 71 bytes
f=n=>n>16&n<20?'10+'+n%10:n<70|n>99?n:n%20?f(n-n%20)+'+'+f(n%20):'4*20'

Bonus version that prints the numbers as they are actually spelled for an extra 2 bytes:
f=n=>n<17|n>99?n:n<20?'10+'+n%10:n%20?f(n-n%20)+'+'+f(n%20):n-80?n:'4*20'

fails for a lot of inputs; actually it only works for 1..20, 30, 40, 50, 60, 80 and 100.

@Titus I think you're misunderstanding most of the outputs. 23, for instance, is supposed to output 23, not 20+3.

Save two bytes with (m=n%20)

@Titus Thanks, but I already tried that, and it doesn't work on 70-99 because m gets reset to 0 in the f(n-n%20) call. (It's a global variable)

You can save a byte by changing n<70|n>99 to n%100<70. Also, could you add a test-compiler?

R, 110 bytes
i=scan()
r=i%%10;paste0(ifelse(i>16&i<20,"10+",ifelse(i>69&i<80,"60+10+",ifelse(i>16&i<20,"4*20+",i-r/10))),r)

Try (i-r)/10 instead of floor(i/10). And i>15 should be i>16.

PHP, 99 bytes (I wanna be happy version)
a straight port of ETHproductions´ JS, 4 bytes golfed. Prints the numbers as asked for by the OP.
function f($n){return$n<17|$n>19?$n>60&$n<100?($m=$n%20)?f($n-$m)."+".f($m):'4*20':$n:"10+".$n%10;}

breakdown
function f($n){return
    $n<17|$n>19
        ?$n>69&$n<100
            ?($m=$n%20)
                ?f($n-$m)."+".f($m) # 70..79, 81..99
                :'4*20'             # 80
            :$n                     # 1..16, 20..69
        :"10+".$n%10                # 17..19
    ;
}

I wanna be right version, 114 98 bytes
new approach inspired by ETHproductions, prints the numbers as they are actually spelled out.
function f($n){return$n>16&$n<100?$n-80?($m=$n%($n>60?20:10))?f($n-$m)."+".f($m):$n-$m:'4*20':$n;}

try it online.
breakdown
function f($n){return
    $n>16&$n<100
        ?$n-80
            ?($m=$n%($n>60?20:10))
                ?f($n-$m)."+".f($m) # $n%$m>0
                :$n-$m              # 10,20,30,40,50,60
            :'4*20'                 # 80
        :$n                         # 1..16, 100
;}

Python 2, 130 108 bytes
22 bytes saved thanks to @mathjunkie
f=lambda x:79<x<100and('4*20'+('+'+f(x-80))*(x>80))or 69<x<100and'60+'+f(x-60)or 16<x<20and'10+'+`x-10`or`x`

Try it online!

108 bytes: TIO

You need to count f= because you used it inside the lambda.

@LeakyNun fixed

Batch, 220 217 bytes
@set/pn=
@set s=
@if %n% gtr 99 goto g
@if %n% gtr 79 set s=+4*20&set/an-=80
@if %n% gtr 69 set s=+60&set/an-=60
@if %n% gtr 16 if %n% lss 20 set s=%s%+10&set/an-=10
:g
@if %n% gtr 0 set s=%s%+%n%
@echo %s:~1%

Takes input on STDIN. Generating and removing the leading + saves 1 byte over special-casing 80. Edit: Saved 3 bytes thanks to @ConorO'Brien.

You can save 3 bytes by removing @echo off and prefixing all statements except for hte loop statement with @

@ConorO'Brien Huh, I wonder why I forgot to do that this time...

Pyth, 61 56 bytes
L?}b}17 19++T\+eb|bk?}/QTr6T.s+?<Q80"60+""4*20+"y%Q20\+y

Test it online!
Thanks to Leaky Nun for a 5 byte improvement!
Explanation:
                     | Implicit: Q=eval(input())
L                    | Define y(b):
 ?}b}17 19           |  If b is in the inclusive range from 17 to 19:
          ++T\+eb    |   Return "10+" + (last digit of b)
                 |b  |  Else: if b!=0: return b
                   k |   Else: return an empty string (Leaves a trailing '+' for case 80)
_____________________|________________
?}/QTr6T                              | If 70<=Q<100:
          +                           |  Concatenate the next two expressions:
           ?<Q80                      |   If Q<80:
                "60+"                 |    Evaluate to "60+"
                     "4*20+"          |    Else: Evaluate to "4*20+"
                            y%Q20     |   y(Q%20)
        .s                       \+   |  Strip off trailing '+', if present (for case 80)
                                   y  | Else: return y(Q)
                                   (Q)| Trailing Q is implicitly added

*-Q100>Q69→}/QTr6T

@]b}17 19→}b}17 19

+"10+"eb→j\+,Teb

@LeakyNun Thanks for the help with golfing! I've made the changes you've suggested.

Jelly, 55 bytes
⁹
’,ṃ60Ṁ€
⁹%80“4*20”,
Dj⁾0+µ¹e?“×ØŒ‘
%ȷ2:“FP‘S‘ŀḟ0Ç€j”+

Try it online! or see a test suite
No doubt there is a shorter way!
How?
+ - Link 1, helper for 1-69&100: number s=0, number n
⁹ - link's right argument, n

’,ṃ60Ṁ€ - Link 2, helper for 70-79: number s=1, number n
’       - decrement s -> 0
 ,      - pair -> [0,n]
  ṃ60   - base decompress (vectorises) using [1,2,...60]  effectively -> [60,[1,n%60]]
     Ṁ€ - maximum for €ach effectively -> [60,n%60]

⁹%80“4*20”, - Link 3, helper for 80-99: number s=2, number n
⁹           - link's right argument, n
 %80        - mod 80
    “4*20”  - literal ['4','*','2','0']
          , - pair -> [['4','*','2','0'],n]

Dj⁾0+µ¹e?“×ØŒ‘ - Link 4, reformat 17-19: element v (may be char list or number)
        ?      - if
       e       - v exists in
         “×ØŒ‘ - literal [17,18,19]
               - then:
D              -   convert to decimal list  e.g. [1,7]
  ⁾0+          -   literal ['0','+']
 j             -   join                          [1,'0','+',7]
     µ         - else:
      ¹        -   identity, v

%ȷ2:“FP‘S‘ŀḟ0Ç€j”+ - Main link: number n in [1,100]
 ȷ2                - literal 100
%                  - mod (convert 100 to 0)
    “FP‘           - literal [70,80]
   :               - integer division (vectorises)
        S          - sum (0 for 1-69&100; 1 for 70-79; 2 for 80-99)
         ‘         - increment (...1, 2 or 3)
          ŀ        - call link at index (1, 2 or 3) as a dyad(sum, n)
           ḟ0      - filter out zeros (remove 0 from 4*20+0)
             Ç€    - call the last link (4) as a monad for each
                ”+ - literal '+'
               j   - join

Python3, 127 bytes
m,r=map,range;l=[*r(1,17),*m("10+{}".format,(7,8,9))];f=[0,*l,*r(20,61),*m("60+{}".format,l),"4*20",*m("4*20+{}".format,l),100]

Each array element contains its representation:
for i in range(1,101):
    print(i, f[i])

The code does not actually create a function, just an array -- I don't know if that's allowed. Otherwise, I'd have to make this 139 bytes by adding f=[...].__getitem__.

Welcome to PPCG! I believe there was a discussion on meta about submitting arrays as mappings from integers to objects, but I can't seem to find it at the moment. I'll let you know if I do (and what the outcome of that discussion was). Either way, you won't need f=, because unnamed functions (i.e. expressions that evaluate to the submitted function) are fine unless the name is needed for something like recursion.

There is no clear consensus, but the marginally top voted answer suggests to allow your solution.

Java 7, 97 96 109 bytes
String c(int i){return i>16&i<20?"10+"+(i-10):i%100<70?i+"":i<80?"60+"+c(i-60):"4*20"+(i<81?"":"+"+c(i-80));}

+13 bytes for bug-fixing case 80.. :(
Explanation:
String c(int i){      // Method with integer parameter and String return-type
  return i>16&i<20?   //  If 17..19:
    "10+"+(i-10)      //   Return "10+" + `i`-10
   :i%100<70?         //  Else if 1..16; 20..69; 100:
    i+""              //   Return `i`
   :i<80?             //  Else if 70..79:
    "60+"+c(i-60)     //   Return "60+" + recursive-call with `i`-60
   :                  //  Else (80..99):
    "4*20"+           //   Return "4*20" +
     (i<81?           //   If 80:
      ""              //    nothing
     :                //   Else (81..99)
      "+"+c(i-80));   //    recursive-call with `i`-80
}                     // End of method

Test code:
Try it here.
class M{
  static String c(int i){return i>16&i<20?"10+"+(i-10):i%100<70?i+"":i<80?"60+"+c(i-60):"4*20"+(i<81?"":"+"+c(i-80));}

  public static void main(String[] a){
    for (int i = 1; i <= 100; i++) {
      System.out.println(c(i));
    }
  }
}

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Moving modest minimum
Inspired by a question over at Stack Overflow. The title here is entirely my fault.

The challenge
Given a list of positive integers containing at least two entries, replace each number by the minimum of all entries excluding itself.
Test cases
[4 3 2 5]    ->  [2 2 3 2]
[4 2 2 5]    ->  [2 2 2 2]
[6 3 5 5 8]  ->  [3 5 3 3 3]
[7 1]        ->  [1 7]
[9 9]        ->  [9 9]
[9 8 9]      ->  [8 9 8]

Rules
The algorithm should theoretically work for any input size (greater than one) and values (positive integers). It's accepted if the program is limited by time, memory or data types and so only works for numbers up to a given value, or for input size up to a given value.
Programs or functions are allowed, in any programming language. Standard loopholes are forbidden.
Input can be taken by any reasonable means; and with any format. Same for output. Input and output formats may be different.
Shortest code in bytes wins.

What should [4 3 2 2 5] output?

@KritixiLithos didn't the second test case cover this?

@KritixiLithos For input [4 3 2 2 5] the output would be [2 2 2 2 2] (this is similar to the second test case)

Oh, I missed the second test case. But now I understand how it works

@LuisMendo You have changed "integer" to "any input size and values". Does that mean we need to account for all real numbers?

@LeakyNun No, I changed it to better reflect the allowed practical limitations of data types and input size. The input consists of positive integers (Given a list of positive integers...). Anyway, I've clarified that part

Jelly, 9 6 5 bytes

JḟÐ€`ị⁸Ṃ€
ṙJṖ€Ṃ€
ṙJṖ«/     argument: 1D array (z)

 J        [1,2,3,...,len(z)]
ṙ         rotate z by each of the above amount (current array is 2D)
  Ṗ       remove the last array
   «/     reduce by [impliclitly vectorized] minimum

Try it online!
Verify all of them at once! (slightly modified)
I'm pretty sure Dennis can out-golf this.
How it works
The algorithm is rather convoluted. Let us observe what this does to [4,2,2,5].
Firstly, we use J to obtain [1,2,3,4]. Note that Jelly uses 1-indexing.
Then, we see ṙ. It takes two arguments: an array and an integer. It rotates the array to the left by an amount specified by the integer. Here, ṙ would see [4,2,2,5] on its left and [1,2,3,4] on its right (more about how this works can be found in the tutorial). In Jelly, commands implicitly vectorize. Therefore, this command will be performed over each individual element on the right, which is why we would create a 2D array:
Therefore, [4,2,2,5]ṙ[1,2,3,4] becomes [[4,2,2,5]ṙ1,[4,2,2,5]ṙ2,[4,2,2,5]ṙ3,[4,2,2,5]ṙ4], which becomes:

[[2,2,5,4],
 [2,5,4,2],
 [5,4,2,2],
 [4,2,2,5]]

Notice that the original elements are on the last row, since in that row we rotated to the left by an amount equal to the length of the array, which is why we use Ṗ next to remove that row, so that the columns are the collections of the elements of the array which are not at the current index:

[[2,2,5,4],
 [2,5,4,2],
 [5,4,2,2]]

The following operation, «/, is also quite convoluted. Firstly, « returns the minimum of the two numbers it sees on its left and on its right. For example, 5«3 returns 3. Now, if the two arguments are arrays, then it would vectorize as I have said above. What this means it that [1,5,2,3]«[4,1,5,2] would become [1«4,5«1,2«5,3«2] which is [1,1,2,2]. Now, / is reduce, which means that we do the operation over each row until the end. For example, [1,2,3,4]+/ would become ((1+2)+3)+4, which is the sum of the array [1,2,3,4].
So, if we apply «/ to the 2D array we just obtained, we would get:
([2,2,5,4]«[2,5,4,2])«[5,4,2,2]

which, because of the vectorization, would be equivalent to:
[2«2«5,2«5«4,5«4«2,4«2«2]

which computes the minimum of every array without the element at the index.

Oh, your edit... you got there first.

@JonathanAllan I'm sorry.

Python 2, 41 bytes
lambda l:[sorted(l)[x==min(l)]for x in l]

Try it online!
For each element x we check whether x==min(l). If not, this is False, which is treated as 0 when used as a list index into sorted(l), giving the smallest element. Otherwise, it's True aka 1, giving the second-smallest element, since that element itself is smallest and should be ignored.

I have a hard time believing that this works.

Great approach!

Could you add an explanation? It wouldn't be very complicated, but the trick of "every number will be the minimum, except for the one that is the minimum, which will be the second-smallest" and the fact that False gets converted to 0 and True gets converted to 1 are really cool and should be bragged about^W^Wexplained

Jelly, 3 bytes
Now possible in 3 bytes, since 2017-08-13:
Ṃ-Ƥ - map minimum over overlapping outfixes of length one less than the input

Try it online!

Original, 5 bytes
=Ṃ‘ịṢ

Try it online!
How?
=Ṃ‘ịṢ - Main link: list a     e.g.  [4,3,2,5]
 Ṃ    - minimum of a                2
=     - equals? (vectorises)        [0,0,1,0]
  ‘   - increment                   [1,1,2,1]
    Ṣ - sort a                      [2,3,4,5]
   ị  - index into                  [2,2,3,2]

Obviously a fork of this Python answer.

@LeakyNun I credit if porting :)

Does this mean you have already credited (which you haven't), or that this is not a port (which it obviously is)?

@LeakyNun This is not a port, it's just the same method, I'm still looking for less too... I have upvoted that answer too now :)

@LeakyNun I am new here, but are you always this hostile? It's not like there are ton of unique ways to approach this. Even if he did port it, he still has the shorter answer.

@GraysonKent I apologize for my perceived hostility.

@GraysonKent Welcome to PPCG!

@LeakyNun This happens a lot in simpler challenges, you can't really say every answer is a port of every other one

Haskell, 42 41 39 bytes
EDIT:

-1 byte thanks to nimi!
-2 bytes. One thanks to xnor! And one by myself.

f takes a list of integers (or any Ord type) and returns a list.
f(x:y)=minimum y:(fst<$>zip(f$y++[x])y)

Try it online!
f recurses while rotating the list. x is the first list element and y the remainder. Since the recursion is infinite, the result list needs to be cut off: fst<$>zip...y is a shorter way of saying take(length y)....

You can save one byte by naming the whole input list via @ and flip the lists to be zipped: f l@(x:y)=fst<$>zip(minimum...)l.

f(h:t)=minimum t:(fst<$>zip(f(t++[h]))t)

Octave, 26 bytes
@(x)sort(x)((x==min(x))+1)

A similar approach as used in this answer, which happens to be the same as this.
I'm not really a fan of just porting other answers, which is why I'd like to note that I had a similar idea before I saw the other ones.
Explanation:
Jonathan Allan has already provided a good explanation for the Jelly-code, so this covers the Octave-bit, and why it works (and wouldn't work in MATLAB).
@(x)                       % An unnamed anonymous function taking a vector x as input
    sort(x)                % Gives a sorted version of x
            (x==min(x))    % Checks if each element is equal to the minimum value
           ((x==min(x))+1) % Adds 1 to the boolean vector, to use as indices
@(x)sort(x)((x==min(x))+1) % Complete function

This doesn't work in MATLAB, since inline assignments and direct indexing doesn't work. sort(x)(1) gives an error in MATLAB, not the first element in the sorted vector.

Haskell, 41 bytes
a#(b:c)=minimum(a++c):(b:a)#c
a#b=b
([]#)

Usage example: ([]#) [4,3,2,5]-> [2,2,3,2]. Try it online!
Start with an empty accumulator a and run down the input list. The next element in the output list is the minimum of the accumulator a and all but the first element of the input list (->c) followed by a recursive call with the first element b added to the accumulator and c. Stop when you reach the end of the input list.

Brachylog, 13 12 bytes
l+₁:?⊇ᶠ⁽⌋ᵐb↔

Try it online!
Saved one byte thanks to @ais523.
Explanation
l+₁:?            The list [length(Input) + 1, Input]
     ⊇ᶠ⁽         Find the length(Input) + 1 first subsets of the Input
        ⌋ᵐ       Get the min of each subset
           b↔    Remove the first element and reverse

We exploit the fact that ⊇ unifies subsets from biggest to smallest. For example for [1,2,3], the subsets we get are in this order: [1,2,3], [1,2], [1,3], [2,3], [1], [2], [3], [].
We can see that the subsets [1,2], [1,3], [2,3] are the ones we want the minimum from, but are in the reverse order compared to the input list (hence the ↔). We can select those subsets only by finding the first length(Input) + 1 subsets, which will contain all of them + the entire list first. We discard that entire list with b.

You can save a byte by splitting your "findall subset+minimum" into "findall subset" and "map minimum". (I need to go add this to the Brachylog tips thread, now you've reminded me of it.)

@ais523 Thanks, I always forget about that trick…

JavaScript (ES6), 50 46 bytes
a=>a.map((_,i)=>Math.min(...a.filter(_=>i--)))

Edit: Saved 4 bytes thanks to @Arnauld.

a=>a.map(x=>Math.min(...a.filter(y=>x!=y))) for 43 bytes.

@Shaggy I don't think that works for an input such as 3,3,3,3

D'oh! No, it won't work if there are 2 or more occurrences of the minimum value.

However, you can do a=>a.map((_,i)=>Math.min(...a.filter(_=>i--))) for 46.

@Arnauld Very clever, thanks!

R, 46 31 bytes
l=scan();sort(l)[(min(l)==l)+1]

implements Stewie Griffin's solution in R, alas, my original idea is 50% longer! still reads the list from stdin, but now returns a much more readable numeric vector.
Try it online!
old implementation:
l=scan();Map(function(x)min(l[-x]),match(l,l))

reads in the list from stdin. A negative index l[-x] excludes the element from the list, and match(l,l) returns the index of the first occurrence of each element of the list. Returns a list.

Hmm.  I was pleased that apply(diag(l<-scan())+l,2,min) was only 30 bytes, until I realised that a rearrangement of yours (sort(l<-scan())[2-(min(l)<l)]) could be only 29...

That's all yours; the 2-(min(l)<l) index is quite clever!

Actually, 13 bytes
;;S╝m╗⌠╜=╛E⌡M

Uses the same technique that xnor also discovered.
Try it online!
Explanation:
;;S╝m╗⌠╜=╛E⌡M
;;             make two extra copies of input list
  S╝           sort one and save it in register 1
    m╗         save the minimum of the other in register 0
      ⌠╜=╛E⌡M  for each value in list:
       ╜=╛E      return the minimum element of the input list if the value is not equal to the minimum, else return the second-smallest element

You still haven't allowed us to look at the global stack inside the temporary stack?

@LeakyNun Not yet. In the current state that the interpreter's code is in, that would be very difficult. After I finish the large refactoring I'm working on, I'll see about adding that functionality.

When did you begin the large refactoring?

Uiua, 8 bytes
/↧÷⊞≠.⍏.

Vyxal port is 10 bytes:
⊏⊃'=/↧'⊏⍏.

Try these online!
/↧÷⊞≠.⍏.    input: a positive integer vector
   ⊞≠.⍏     a matrix of the size of the input where the diagonal is 0s and
              the rest are 1s
  ÷      .    divide each number in the input by each row of the above matrix,
              giving infinities where division by 0 occurs
/↧            minimum of each column

⊏⊃'=/↧'⊏⍏.
 ⊃        .   fork on two functions with two copies of input vectors as arguments:
   '=/↧        for each element, 1 if it is the minimum, 0 otherwise
       '⊏⍏    input sorted
⊏              select 0th or 1st item from the sorted list

Alternative 8:
⊏=0⊃⍏⊏⍏.

Try it online!
⊏=0⊃⍏⊏⍏.
   ⊃⍏⊏⍏.    take the input array and push (rank, sorted)
     ⍏  ⍏     rank: lowest number is replaced with 0, next lowest 1, ...
       ⊏⍏.     sorted: lowest number is placed first, next 2nd, ...
 =0             for each element, 1 if rank is 0, 0 otherwise
⊏               select 1st in the sorted array if rank 0, 0th otherwise

Python 2, 51 bytes
I know there's already a better Python solution, but I still want to post mine.
lambda L:[min(L[:i]+L[i+1:])for i in range(len(L))]

Try it online

Mathematica 34 Bytes
Min[#~Drop~{i}]~Table~{i,Tr[1^#]}&

PowerShell, 68 59 bytes
($a=$args)|%{$b+=@((($c=$a|sort)[0],$c[1])[$_-eq$c[0]])};$b

Try it online!
I'm pretty confident it can be shortened, I will continue to look at it

C, 85 bytes
i,j,m;f(d,o,n)int*d,*o;{for(i=n;i--;)for(m=d[!i],j=n;j;o[i]=m=--j^i&&d[j]<m?d[j]:m);}

First argument is the input integer array. The second argument is the output integer array. The third argument is the element count for both arrays.
See it work online.

Pyth, 8 7 bytes
mh.-SQ]

-1 Byte thanks to @isaacg
Try it!

You can remove the d at the end - it's implicitly filled in.

@isaacg thank you, didn't know that

Clojure, 36 81 62 71 bytes
Newest (shouldn't really submit these in a hurry):
#(for[c[(zipmap(range)%)]i(sort(keys c))](apply min(vals(dissoc c i))))

Try it online.
Aaaand this one has a bug (62 bytes), zipmap produces an unordered map so this won't produce the correct sequence on larger inputs.
#(for[c[(zipmap(range)%)][i v]c](apply min(vals(dissoc c i))))

v is not actually used for anything but this is shorter than i (keys c).
Previous at 81 bytes:
Try it online.
#(let[r(range(count %))](for[i r](apply min(for[j r :when(not= i j)](nth % j)))))

Try it online.
Oh damn the original (36 bytes) does not work when the minimum number is repeated, [4 2 2 5] results in [2 4 4 2] as both 2s are removed :(
#(for[i %](apply min(remove #{i}%)))

#{i} is the set which contains only i, it returns truthy for i and falsy for others, meaning that the minimum is calculated from all other numbers within the input list.
Try it online.

Perl 6,  26 24  19 bytes
26
{.map: (.Bag∖*).min.key}

Note that is ∖ U+2216 not \ U+5C
Try it
{.map: (.Bag⊖*).min.key}

Try it
24
{(.min X%$_)X||.sort[1]}

Try it
19
{.sort[.min X==$_]}

Try it

26
{           # bare block lambda with implicit parameter ｢$_｣

  .map:     # for each of the values in the input (implicit method call on ｢$_｣)
  (
    .Bag    # turn the block's input into a Bag
    ∖       # set-difference           ｢∖｣ U+2216 aka ｢(-)｣
    # ⊖     # symmetric-set-difference ｢⊖｣ U+2296 aka ｢(^)｣
    *       # turn expression into a WhateverCode lambda (this is the parameter)
  ).min.key # get the minimum pair from the Bag, and return its key
}

I used the "fancy" unicode operators rather than the ascii equivalents because they would have required a space before them so that they wouldn't be parsed as part of the .Bag method call.
24
{
  (.min X% $_) # the minimum cross modulus-ed with the input
  X||          # cross or-ed
  .sort[1]     # with the second minimum
}

19
{
  .sort\        # sort the values
  [             # index into that
    .min X== $_ # the minimum cross compared with the input
  ]
}

(The 24 and 19 byte golfs were inspired by a Jelly implementation)

Factor, 38 bytes
[ all-rotations [ rest infimum ] map ]

Try it online!
Get all the rotations of the input, then get the smallest element in each rotation minus the first element. Like this:
\$\begin{matrix}
4 & 3 & 2 & 5 \\
\end{matrix} \rightarrow\$

\$\require{enclose}\begin{matrix}\enclose{horizontalstrike}{4} & 3 & \color{red}{2} & 5 \\
\enclose{horizontalstrike}{3} & \color{red}{2} & 5 & 4 \\
\enclose{horizontalstrike}{2} & 5 & 4 & \color{red}{3} \\
\enclose{horizontalstrike}{5} & 4 & 3 & \color{red}{2} \\
\end{matrix} \rightarrow\$

\$\begin{matrix}
2 & 2 & 3 & 2 \\
\end{matrix}\$

J, 7 bytes
1<./\.]

Attempt This Online!
J's outfix adverb \. is made for this.  It applies a verb (in this case min) to every outfix of a list of a specified size (in this case 1).  Outfix being the inverse operation of "window" functions which exist in most languages -- a list composed of the original list without a window as that window moves across the list.

This outfix adverb is neat. Even its name is!

Scala, 37 bytes
l.indices map(i=>l diff Seq(l(i))min)

l is any collection of Int.
Test cases:
scala> val l = List(4,3,2,5)
l: List[Int] = List(4, 3, 2, 5)

scala> l.indices map(i=>l diff Seq(l(i))min)
res0: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 2, 3, 2)

scala> val l = List(4,2,2,5)
l: List[Int] = List(4, 2, 2, 5)

scala> l.indices map(i=>l diff Seq(l(i))min)
res1: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 2, 2, 2)

scala> val l = List(6,3,5,5,8)
l: List[Int] = List(6, 3, 5, 5, 8)

scala> l.indices map(i=>l diff Seq(l(i))min)
res2: scala.collection.immutable.IndexedSeq[Int] = Vector(3, 5, 3, 3, 3)

scala> val l = List(7,1)
l: List[Int] = List(7, 1)

scala> l.indices map(i=>l diff Seq(l(i))min)
res3: scala.collection.immutable.IndexedSeq[Int] = Vector(1, 7)

scala> val l = List(9,9)
l: List[Int] = List(9, 9)

scala> l.indices map(i=>l diff Seq(l(i))min)
res4: scala.collection.immutable.IndexedSeq[Int] = Vector(9, 9)

scala> val l = List(9,8,9)
l: List[Int] = List(9, 8, 9)

scala> l.indices map(i=>l diff Seq(l(i))min)
res5: scala.collection.immutable.IndexedSeq[Int] = Vector(8, 9, 8)

This can probably still be golfed, I couldn't find a shorter way to remove an element from a list than l diff Seq(l(i))

PHP, 72 Bytes
<?$k=$g=$_GET;sort($k);foreach($g as&$v)$v=$k[$v==$k[0]?:0];print_r($g);

Online Version

PHP, 47 bytes
while(++$i<$argc)echo@min([z,$i=>z]+$argv),' ';

C#, 36 Bytes
i.Select((x,a)=>i.Where((y,b)=>b!=a).Min())

Takes the elements (i) and looks in the elements without the current item for the minimal value.
It's kind of sad, that some other attempts don't work, as we work with primitive types, and therefore don't have lists with references to compare the items from.

05AB1E, 5 bytes
{sWQè

Port of @xnor's Python 2 answer.
Try it online or verify all test cases.
Explanation:
{        # Sort the (implicit) input-list
         #  i.e. [4,1,3,6] → [1,3,4,6]
 s       # Swap, so the (implicit) input-list is at the top of the stack again
  W      # Get the minimum without popping from the list
         #  i.e. [4,1,3,6] → 1
   Q     # Check for each element if they are equal to this value (1/0 as truthy/falsey)
         #  i.e. [4,1,3,6] and 1 → [0,1,0,0]
    è    # Use these 0s and 1s to index in the sorted list
         #  i.e. [1,3,4,6] and [0,1,0,0] → [1,3,1,1]

APL (Dyalog Extended), 7 bytes
Port of xnor's Python 2 answer. Requires ⎕IO←0:

∧⊇⍨⊢=⌊/

Try it online!
Explanation:
∧⊇⍨⊢=⌊/  ⍝ Monadic function train
      ⌊/  ⍝ The minimum element of the input
    ⊢=    ⍝ Element-wise compare the input to the above
          ⍝ Results in a boolean vector, let's call it "X"
∧         ⍝ Sort the input
 ⊇⍨      ⍝ Index into sorted input by X

Dyalog Vision allows saving a byte with ⌈/⍛=⊇≤

PowerShell, 49 38 bytes
-11 bytes thanks to mazzy

($a=$args)|%{($c=$a|sort)[$_-eq$c[0]]}

Try it online!
Improvement of Sinusoid's lovely answer. Saves 10 bytes by using explicit output instead of building an array. Indexes into the sorted array to either spot 0 (i.e. smallest value) or spot 1 if the conditional is true.

It's smart. Save more :) Try it online!

@mazzy Well done. It's obvious now that I see it but I never would've put that together.

Nice work! Yours is more lovely :)

Husk, 6 bytes
mo▼`-¹

Try it online!

K (ngn/k), 12 bytes
{(&/x_)'!#x}

Try it online!
Uses list _ int to remove individual values from the input, then takes the minimum of the remaining values.

Vyxal, 5 bytes
s∇g=İ

Try it Online!
How?
s∇g=İ
s      # Sort the input
 ∇     # Push this two values down so that there are two copies of the input on top
  g    # Get the minimum of the input
   =   # For each in the input, is it equal to that?
    İ  # Index this into the sorted list

Arturo, 28 bytes
$[a][map a=>[min a--.once&]]

Try it
$[a][             ; a function taking an argument a
    map a=>[      ; map over each element in a
        min       ; the minimum element of
        a--.once& ; a with the current element removed (only once)
    ]             ; end map
]                 ; end function

Japt, 8 bytes
£éYn)Årm

Try it
Try all test cases
Explanation:
£        # For each index Y in the input, copy the input then:
 é  )    #  Rotate right by
  Yn     #   Negative Y
     Å   #  Remove the first item
      rm #  Get the minimum of the rest
         # Implicitly return an array of the results

Desmos, 26 bytes
f(x)=x.sort[1+0^{x-x.min}]

Try it on Desmos!
Port of this answer.

Perl 5, 43 bytes
sub{@x=sort{$a<=>$b}@_;map$x[$_==$x[0]],@_}

Equivalent to the Python solution. Perl's sort unfortunately has the wrong default for numbers (requiring an explicit comparator), and min isn't built-in, but it almost makes up for it by sub being shorter than lambda, map$_, being shorter than x for x in, and the implicitness of return and args lists.

CJam, 15 bytes
{:S{S:e<=S$=}%}

Essentially a translation of xnor's algorithm into CJam.
This is an unnamed block that takes an array from the stack and leaves the result on the stack.
Explanation:
{
  :S     e# Save in S
  {      e# For X in S:
    S:e< e#   Push Min(S)
    =    e#   X == Min(S)
    S$=  e#   Sorted(S)[top of stack]
  }%     e# End
}

@LuisMendo Whoops - I forgot to actually sort the array. It should work now.

Ruby, 30 bytes
For each element, sort the array, remove the current element and grab the first element of the remaining array.
->a{a.map{|e|(a.sort-[e])[0]}}

It's an anonymous function that can be used like this:
f = ->a{a.map{|e|(a.sort-[e])[0]}}
p f[[6, 3, 5, 5, 8]] # => [3, 5, 3, 3, 3]

Java 8, 119 bytes
a->{int t[]=a.clone(),m=a[0],i=a.length;for(int x:a)m=x<m?x:m;for(java.util.Arrays.sort(t);i-->0;)a[i]=t[a[i]==m?1:0];}

Port of @xnor's Python 2 answer.
Modifies the input-array instead of returning a new one to save bytes.
Try it online.
Explanation:
a->{                  // Method with integer-array parameter and no return-type
  int t[]=a.clone(),  //  Make a copy of the input-array
      m=a[0],         //  Minimum `m`, starting at the first value of the input-array
      i=a.length;     //  Index-integer, starting at the length of the input-array
  for(int x:a)        //  Loop over the input-array
    m=x<m?            //   If the current item is smaller than the current `m`
       x              //    Replace `m` with this value
      :               //   Else:
       m;             //    Leave `m` the same
  for(java.util.Arrays.sort(t);
                      //  Sort the copy we've made of the input-array
      i-->0;)         //  Loop `i` in the range (length, 0]
    a[i]=             //   Modify the item at index `i` of the input-array to:
      t[              //    The item in the sorted array at index:
        a[i]==m?      //     If the current item and the minimum are equal:
         1            //      Use index 1 in the sorted array
        :             //     Else:
         0];}         //      Use index 0 in the sorted array

Haskell, 76 bytes
This is considerably longer than the earlier Haskell entries, but it's the first that only performs a linear number of comparisons and a linear amount of additional work.
f(x:y)|(z,w)<-x!y=z:w
a![x]=(x,[a])
a!(x:y)|(p,q)<-a#x!y=(x#p,a#p:q)
(#)=min

Try it online!
Explanation
! takes two arguments: a running minimum and a nonempty list. It returns the minimum value in the list and the result of processing the given list using the running minimum.

MathGolf, 9 7 bytes
s_╓?m=§

Try it online!
Explanation
Basically a port of Kevin Cruijssen's 05AB1E answer, but I lose 2 bytes thanks to having to do things explicitly.
s         sort(array)
 _        duplicate TOS
  ╓       minimum of two elements, min of list, minimum by filter
   ?      rot3 pops input on top of stack again
    m=    explicit map to check equality
      §   get from sorted array for each

APL(NARS), 47 chars, 94 bytes
{m←⌊/⍵⋄⍵{⍵>≢⍺:⍬⋄t←⍺∇⍵+1⋄m=⍵⊃⍺:(⌊/⍺∼⍦m),t⋄m,t}1}

∼⍦ it seems is using for remove one element only 1 times; possible it is too much long for you... test:
  f←{m←⌊/⍵⋄⍵{⍵>≢⍺:⍬⋄t←⍺∇⍵+1⋄m=⍵⊃⍺:(⌊/⍺∼⍦m),t⋄m,t}1}
  f 4 3 2 5
2 2 3 2
  f 4 2 2 5
2 2 2 2
  f 6 3 5 5 8
3 5 3 3 3
  f 7 1
1 7
  f 9 9
9 9
  f 8 9 8
8 8 8
  f 9 8 9
8 9 8

Nekomata, 3 bytes
ĕ^ṁ

Attempt This Online!
ĕ^ṁ
ĕ       Extract one item from the list
            For example, there are 4 possible extractions from [4,3,2,5]: 4 [3,2,5], 3 [4,2,5], 2 [4,3,5], 5 [4,3,2]
 ^      Drop the extracted item
            The above example becomes [3,2,5], [4,2,5], [4,3,5], [4,3,2]
  ṁ     Take the minimum of the remaining list
            The above example becomes 2, 2, 3, 2
        All possible solutions are returned


text:
Number Lockers!
Given a positive integer < 100 (from 1 to 99, including 1 and 99), output that many lockers.
A locker is defined as the following:
+----+
|    |
|    |
|    |
| nn |
+----+

where nn is the locker number, in base 10. If there is 1-digit number, it is expressed with a 0 in front of it. For example, locker number 2 displays the number 02.
Lockers can be stacked, but only up to 2 high:
+----+
|    |
|    |
|    |
| on |
+----+
|    |
|    |
|    |
| en |
+----+

on denotes an odd number, en an even number. Lockers can also be put next to each other.
+----+----+
|    |    |
|    |    |
|    |    |
| 01 | 03 |
+----+----+----+
|    |    |    |
|    |    |    |
|    |    |    |
| 02 | 04 | 05 |
+----+----+----+

Notice that locker number 5 is an odd-numbered locker that is on the bottom. This is because when you have odd-numbered input, the last locker should be placed on the floor (because a hovering locker costs too much). The above example therefore is the expected output for n=5. n=0 should return an nothing.
Rules: Standard methods of input/output. Input in any convenient format, output as a string. Standard loopholes apply.
Test cases:
Input
Output
---------------------
1

+----+
|    |
|    |
|    |
| 01 |
+----+
--------------------- (newlines optional in case 1)
4
+----+----+
|    |    |
|    |    |
|    |    |
| 01 | 03 |
+----+----+
|    |    |
|    |    |
|    |    |
| 02 | 04 |
+----+----+
---------------------
5
+----+----+
|    |    |
|    |    |
|    |    |
| 01 | 03 |
+----+----+----+
|    |    |    |
|    |    |    |
|    |    |    |
| 02 | 04 | 05 |
+----+----+----+
---------------------
16
+----+----+----+----+----+----+----+----+
|    |    |    |    |    |    |    |    |
|    |    |    |    |    |    |    |    |
|    |    |    |    |    |    |    |    |
| 01 | 03 | 05 | 07 | 09 | 11 | 13 | 15 |
+----+----+----+----+----+----+----+----+
|    |    |    |    |    |    |    |    |
|    |    |    |    |    |    |    |    |
|    |    |    |    |    |    |    |    |
| 02 | 04 | 06 | 08 | 10 | 12 | 14 | 16 |
+----+----+----+----+----+----+----+----+

This is code-golf, so shortest code wins!

Related

It's time to tell the builders to put the odd lockers on the bottom.

Do the prepending newlines of the case 1 have to be outputted?

@ComradeSparklePony didn't impact me at all :). Sorry about the harsh tone used, just trying to help.

Pyth, 66 bytes
A.[Y2m+.rKXJr6j" | "++km.[\02`kdkjkUT;" -|+"+*3]KJ_.T_McSQ2js[GHhH

Test suite.

Python 2, 201 191 185 175 171 166 164 163 bytes
n=input()
for j in 0,1:c=n/2+n%2*j;m='+----'*c+'+\n';print['\n',m+('|    '*c+'|\n')*3+''.join('| %02d '%-~i for i in range(j,n-n%2,2)+n%2*j*[~-n])+'|\n'+m*j][c>0],

Try it Online!

This currently fails on the first test case.

@ComradeSparklePony Fixed

PHP, 191 Bytes
for(;a&$k="01112344453"[$i++];print"$l\n")for($l="",$b="+||"[$k%3],$n=0;$n++<$a=$argn;)$l.=$i<6&$n%2&$n!=$a|$i>5&($n%2<1|$n==$a)?($l?"":"$b").["----+","    |",sprintf(" %02d |",$n)][$k%3]:"";

Try it online!
PHP, 235 Bytes
for(;$i++<$a=$argn;)$r[$i==$a|1-$i&1][]=($p=str_pad)($i,2,0,0);for(;$j<6;)$l[]=($a<2&$j<3?"":[$p("+",$c=($j<3?floor:ceil)($a/2)*5+1,"----+"),$p("|",$c,"    |"),"| ".join(" | ",$r[$j/3])." |"])[$j++%3]."\n";echo strtr("01112344453",$l);

Case 1 with optional newlines
Try it online!
Expanded
for(;$i++<$a=$argn;)
  $r[$i==$a|1-$i&1][]=($p=str_pad)($i,2,0,0); # make an 2D array 0:odd values 1:even values and last value
for(;$j<6;) # create 6 strings for each different line
  $l[]=($a<2&$j<3 # if last value =1 and line number under 3
    ?"" # make an empty string empty [] as alternative
    :[$p("+",$c=($j<3 # else make the 0 or 3 line and store the count for next line
      ?floor # if line number =0 count=floor ($a/2)  multiply 5 and add 1
      :ceil)($a/2)*5+1,"----+") # else count= ceil($a/2) multiply 5 and add 1
    ,$p("|",$c,"    |") # make lines 1 and 4
    ,"| ".join(" | ",$r[$j/3])." |"])[$j++%3]."\n"; #make lines 2 odd values and 5 even values and last value
echo strtr("01112344453",$l); # Output after replace the digits with the 6 strings

PHP, 300 Bytes
for(;$i++<$a=$argn;)$r[$i==$a||!($i%2)][]=($p=str_pad)($i,2,0,0);echo strtr("01112344453",($a>1?[$p("+",$c=($a/2^0)*5+1,"----+")."\n",$p("|",$c,"    |")."\n","| ".join(" | ",$r[0])." |\n"]:["","",""])+[3=>$p("+",$c=ceil($a/2)*5+1,"----+")."\n",$p("|",$c,"    |")."\n","| ".join(" | ",$r[1])." |\n"]);

replace ["","",""] with ["\n","\n","\n"] if you want newlines for case 1
Try it online!

C (gcc), 426 335 300 294 282 252 249 246 244 237 bytes
This really needs to be golfed down
#define L puts("")
#define P(s)printf(&s[i>1]
#define F(x)for(i=0;i++<x;)P(
#define O(x,y)F(x)"+----+"));for(j=0;L,j++<3;)F(x)"|    |"));j=y;F(x)"| %02d |")
e,i,j;f(n){e=n/2+n%2;O(n/2,-1),j+=2);L;O(e,0),j+=i^e?2:2-n%2);L;F(e)"+----+"));}

Try it online!

Suggest -~n/2 instead of n/2+n%2

Ruby, 256 239 201 191 183 bytes
n=gets.to_i;a=n/2;z=a+n%2;t=a*2;q="+----+";r=->x{q*x+?\n+("|    |"*x+?\n)*3+"| n |"*x+?\n};u=r[a]+r[z]+q*z;n.times{|i|j=2*i+1;u[?n]="%02d"%(i=t ?j-t:j-t+1)};puts u.squeeze'+|'

This is awfully long. I'll work on golfing it more.

Batch, 305 bytes
@echo off
set/a"n=%1&-2
if %1 gtr 1 call:l %n% 1
call:l %1 2
echo %s: =-%
exit/b
:l
set s=+
set "t=|
for /l %%i in (%2,2,%n%)do call:c %%i
if %1 gtr %n% call:c %1
for %%s in ("%s: =-%" "%s:+=|%" "%s:+=|%" "%s:+=|%" "%t%")do echo %%~s
exit/b
:c
set s=%s%    +
set i=0%1
set "t=%t% %i:~-2% |

+----+ and |    | are both similar to +    + in that they can be generated via a single substitution, and it turns out to be slightly shorter than generating them separately (the extra quoting needed for |s doesn't help).

Pyth - 97 74 86 80 75 bytes
V3K+:?&NtQ2 1Q2?NQYIlK+*+\+*\-4lK\+IqN2BFTU4+sm?qT3.F"| {:02d} "d+\|*\ 4K\|

Try it here

Sorry, but this currently fails on input of 1.

@ComradeSparklePony Fixed it.  Thanks.

JavaScript ES6, 224 bytes
n=>(r=(s,k)=>s.repeat(k),s="",[0,1].map(i=>(c=(n/2+n%2*i)|0,c&&(s+="+"+r(l="----+",c)+`
|`+r(r("    |",c)+`
|`,3),[...Array(c).keys()].map(j=>s+=` ${(h=2*j+(i+!(i&j>c-2&n%2)))>9?h:"0"+h} |`),s+=`
`+(i?`+${r(l,c)}
`:"")))),s)

Used some ideas from math junkie's Python answer
Test Snippet

f=
n=>(r=(s,k)=>s.repeat(k),s="",[0,1].map(i=>(c=(n/2+n%2*i)|0,c&&(s+="+"+r(l="----+",c)+`
|`+r(r("    |",c)+`
|`,3),[...Array(c).keys()].map(j=>s+=` ${(h=2*j+(i+!(i&j>c-2&n%2)))>9?h:"0"+h} |`),s+=`
`+(i?`+${r(l,c)}
`:"")))),s)

O.innerHTML=f(I.value);
<input id="I" value="5" type="number" min="0" max="99" oninput="O.innerHTML=f(this.value)">

Cleaned up
n => {
    r=(s,k)=>s.repeat(k);
    s="";
    [0,1].map(i => {
        c = (n/2 + n%2 * i)|0;
        if (c) {
            s += "+" + r(l="----+", c) + "\n|" + r(r("    |",c) + "\n|", 3);
            [...Array(c).keys()].map(j => {
                s += ` ${(h = 2*j + (i + !(i & j>c-2 & n%2))) > 9 ? h:"0"+h} |`;
            });
            s += "\n" + (i ? `+${r(l,c)}\n` : "");
        }
    });
    return s;
};

Welcome to PPCG!

Charcoal, 37 bytes
ＮθＦ…·¹θ«Ｆ⁵¿﹪ι²¿⁼ιθ→↗↓Ｂ⁶±⁶↗→→0Ｐ←⮌Ｉι←←↙

Try it online! Link is to verbose version of code. Explanation:
Ｎθ

Input the number of lockers into q.
Ｆ…·¹θ«

Loop over the lockers from 1 to q inclusive.
Ｆ⁵¿﹪ι²¿⁼ιθ→↗↓

Calculate the direction to the next locker, and repeat that 5 times (golfier than using jump movements).
Ｂ⁶±⁶

Draw the locker, starting at the bottom left corner. (The bottom right corner also takes 4 bytes while the top right corner takes 5. The top left corner only takes 3 bytes but then the locker number would take longer to draw.)
↗→→0

Draw the leading zero of the locker number, if necessary.
Ｐ←⮌Ｉι

Draw the locker number reversed and right-to-left, effectively right justifying it.
←←↙

Move back to the bottom left corner ready to calculate the direction to the next locker.
Edit: Later versions of Charcoal support this 32-byte solution:
Ｆ⪪…·¹Ｎ²«Ｆ⮌ι«↗→→0Ｐ←⮌Ｉκ↖↖↖↑ＵＲ⁶»Ｍ⁵χ

Try it online! Link is to verbose version of code. Explanation:
Ｆ⪪…·¹Ｎ²«

Take the numbers from 1 to the input number inclusive pairwise. (If the input number is odd the last array will only have one element.)
Ｆ⮌ι«

Loop over each pair in reverse order.
↗→→0

Draw the leading zero of the locker number, if necessary.
Ｐ←⮌Ｉι

Draw the locker number reversed and right-to-left, effectively right justifying it.
↖↖↖↑ＵＲ⁶

Move to the top left of the locker and draw it. This is also the bottom left of the next locker, so we're ready to draw the second locker of the pair if applicable.
»Ｍ⁵χ

Move to the next pair of lockers. (This should be before the inner loop for a saving of 1 byte but Charcoal generates incorrect output for an input of 1 for some reason.)

Vyxal, 127 bytes
½⌊:\+4-*\++,3(:\|4꘍*\|+,)?ɾ'∷n⁰≠∧;ƛS:₃[0p]`| `pð+;ṅ\|+,?½⌈:\+4-*\++,3(:\|4꘍*\|+,)?ɾ'₂n⁰=n∷∧∨;ƛS:₃[0p]`| `pð+;ṅ\|+,?½⌈:\+4-*\++,

Try it Online!
This is horrible.


text:
The mad chemist and the clever programmer
Backstory
You wake up dizzy in a chemistry laboratory, and you realize you have been kidnapped by a old mad chemist. Since he cannot see very well because of his age, he wants you to work for him and only then, you can escape the laboratory.
Task
It is your task to return the structural formulae of the molecules whose chemical formula will be given as input. Note that only the carbon (C), oxygen (O) and hydrogen (H) atoms will be used as input. Unlike in chemical formulas, a 0 is a valid quantifier and a 1 cannot be omitted (e.g. C1H4O0 is valid input, but CH4 isn't).
To prevent ambiguity, we assume double and triple bonds do not appear in the molecules. All carbon atoms need 4 single bonds, all oxygen atoms need 2, and hydrogen atoms need one. We also assume that O-O bonds do not exist as well. The molecule does not have to exist nor be stable.
The input will never contain more than 3 carbon atoms to ensure lightness in the output's display.
You only should display the molecules whose carbons atoms are arranged in a straight line without interruption. Ergo, no C-O-C bonds.
You must return all possible molecules not excluded by the previous rules. You do not need to handle invalid inputs.
The following example displays all the solutions you have to handle for that molecule.
A rotation by 180 degrees in the plane of the page of one of the molecule's formula is considered a redundancy and does not need to be displayed.
In the example below I'll show all of the possible formulae for a molecule, then point out the ones that do not need to be displayed.
Example
Input: C2H6O2
First, here are all the possible formulae for this input (Thank you to @Jonathan Allan)
01        H
          |
          O   H
          |   |
  H - O - C - C - H
          |   |
          H   H

02            H
              |
          H   O
          |   |
  H - O - C - C - H
          |   |
          H   H

03        H   H
          |   |
  H - O - C - C - O - H
          |   |
          H   H

04        H   H
          |   |
  H - O - C - C - H
          |   |
          H   O
              |
              H

05        H   H
          |   |
  H - O - C - C - H
          |   |
          O   H
          |
          H

12        H   H
          |   |
          O   O
          |   |
      H - C - C - H
          |   |
          H   H

13        H
          |
          O   H
          |   |
      H - C - C - O - H
          |   |
          H   H

14        H
          |
          O   H
          |   |
      H - C - C - H
          |   |
          H   O
              |
              H

15        H
          |
          O   H
          |   |
      H - C - C - H
          |   |
          O   H
          |
          H

23            H
              |
          H   O
          |   |
      H - C - C - O - H
          |   |
          H   H

24            H
              |
          H   O
          |   |
      H - C - C - H
          |   |
          H   O
              |
              H

25            H
              |
          H   O
          |   |
      H - C - C - H
          |   |
          O   H
          |
          H

34        H   H
          |   |
      H - C - C - O - H
          |   |
          H   O
              |
              H

35        H   H
          |   |
      H - C - C - O - H
          |   |
          O   H
          |
          H

45        H   H
          |   |
      H - C - C - H
          |   |
          O   O
          |   |
          H   H

And here are the formulae that should be in the output if we take out the rotations of 180° in the plane of the page  :
01        H
          |
          O   H
          |   |
  H - O - C - C - H
          |   |
          H   H

03        H   H
          |   |
  H - O - C - C - O - H
          |   |
          H   H

12        H   H
          |   |
          O   O
          |   |
      H - C - C - H
          |   |
          H   H

13        H
          |
          O   H
          |   |
      H - C - C - O - H
          |   |
          H   H

14        H
          |
          O   H
          |   |
      H - C - C - H
          |   |
          H   O
              |
              H

 15      H
         |
         O   H
         |   |
     H - C - C - H
         |   |
         O   H
         |
         H

23            H
              |
          H   O
          |   |
      H - C - C - O - H
          |   |
          H   H

25            H
              |
          H   O
          |   |
      H - C - C - H
          |   |
          O   H
          |
          H

35        H   H
          |   |
      H - C - C - O - H
          |   |
          O   H
          |
          H

You do not need to output the labels of the formulae and you can output either of the rotations when two exist. For example you can output either 02 or 35.
Here are some valid inputs to test your code:
C3H8O2 C1H4O0 C2H6O2 C1H4O1 C2H6O2

The PC the chemist gave you to complete your task is quite old so you do not have a lot of memory on it to save your code, thus this is code-golf and the shortest amount of byte wins!

Do we need to handle cyclic molecules?

@Luke The inputs I gave cannot be cyclic so you do not need to handle that. But if you want to handle molecules that contains 4 C or more you can do it and earn bonus score :) Thanks for the edit by the way! english is not my native language ^^

@Antoine Given your current challenge description, handling molecules with any number of Carbon atoms (including 4 or more) is required.

The output you've suggested is missing a lot of potential molecules: you have two copies of propan-1,2-diol there, but is missing at least propan-1,1-diol, propan-1,3-diol, propan-2,2-diol, a large number of alcohol ethers, and various compounds where the two oxygen atoms connect to each other. Additionally, how specified is the output format? I can imagine molecules in which some of the bonds need to be drawn longer than others to fit everything in (e.g. dimethylpropane, which is apparently a real chemical).

@ais523 Before the last edit it was specified that the output I wrote did not display ALL the molecules possible for the formula, I added it back. Concerning the neopentane you linked it contains 5 carbons, the inputs needed to work with the code contains 3 C maximum, which allows a clearer display

@JonathanAllan Can you explain what is missing to make the challenge clearer please ?

@JonathanAllan Ok I'll submit it to sandbox and edit later with the completed specifications

I hope that the chemist is really mad, so he won't find out that all of the molecular structures in the example are the same molecule (just rotated)... :)

@mzuther Technically yes it's the same molecule, just different symetries, but he doesn't see very well anyway ;)

Is it possible to have 2 OH groups on the same carbon? You seem to have excluded it from the examples, but I don't see anywhere in the spec that says we don't have to consider it (I know in reality these compounds exist in equilibrium with aldehydes) 2. Why is the HOCH2CH2OH with both OH groups pointing downards missing from the example? Isn't it a required output?

Is it acceptable to have the outputs with the carbon chain vertical instead of horizontal?

@LevelRiverSt It is indeed possible to have 2 OH group on the same carbon I totally forgot to add them and I'll do it right away ^^ Concerning the ouput it is totally acceptable to rotate it to have the carbon displayed vertically. And for your concern about the symetry with both OH group poitning down, it's because it's a rotation of pi of the first molecule. Thanks for pointing these concerns :)

In that case the first and last structures on the 3rd row should be absent, as they are rotations of structures given previously. (They are also mirror images but it would seem that mirror images are considered different.)

@LevelRiverSt I agree for the first of the 3rd row but can't find where the 3rd one is rotated ?

@JonathanAllan The pi rotation is about the whole molecule not only a part of it. That's why you cannot consider that r1c1, r1c3, r2c2, r3c1, and r3c3are equivalent by rotation, because that would mean you only rotated a part of the molecule. Could you please explain further your labeling system? I'm interested

@JonathanAllan Indeed the couples you mention have a symetry with the vertical or horizontal axis, however, if you turn the whole molecule you cannot achieve the transformation from r1c3 to r2c1 etc. That's why I consider them to be different, contrary to rotations which are redundancies. If you think it's a flaw I think we can correct the question

Is it required to omit said symmetries, or is it allowable to do so?

@TLW The redundancies do not need to be displayed but if you want to let them remain you can

Can I answer it graphically instead of ASCII art?

@sergiol Sure as long as it respects the format

Ruby, 275
->s{(k=4<<2*c=s[1].to_i).times{|i|z=" "*8
t=("  H|O|"[i%2*2,4]+"C|"*c+"O|H   "[i>>c&2^2,4]).chars.map{|j|z+j+z}
(c*2).times{|j|t[4+j&-2][j%2*10,7]="    H - O - H    "[[i>>j/2-1&4,-7-(i>>c*2-j/2-1&4)][j%2],7]}
i*(k+1)>>c+1&k-1<i||("%b"%i).sum%16!=s[5].to_i||i%7>c*3||puts(t)}}

Combined formulas for left and right sidechains and eliminated variable h
Ruby, 279
->s{(k=1<<h=2+2*c=s[1].to_i).times{|i|t=("  H|O|"[i%2*2,4]+"C|"*c+"O|H   "[i>>c&2^2,4]).chars.map{|j|(z=" "*8)+j+z}
c.times{|j|t[4+j*2][0,7]="    H - O -"[i>>j-1&4,7]
t[4+j*2][10,7]="- O - H    "[i>>h-j-3&4^4,7]}
i*(k+1)>>h/2&k-1<i||("%b"%i).sum%16!=s[5].to_i||i%7>c*3||puts(t)}}

Ungolfed in test program
f=->s{
  (k=1<<h=2+2*c=s[1].to_i).times{|i|                       #c=number of C atoms. h=number of H (calculated)
                                                           #iterate i from 0 to (k=1<<h)-1

  t=("  H|O|"[i%2*2,4]+"C|"*c+"O|H   "[i>>c&2^2,4]).       #compose a backbone string H-C...C-H. Insert O at the top where bit 0 of i set, and O at the bottom where bit c+1 of i set
  chars.map{|j|(z=" "*8)+j+z}                              #convert string to an array of characters, pad each character left and right with 8 spaces

  c.times{|j|t[4+j*2][0,7]="    H - O -"[i>>j-1&4,7]       #overwrite spaces on left with H or HO according to bits 1 up to c
             t[4+j*2][10,7]="- O - H    "[i>>h-j-3&4^4,7]} #overwrite spaces on right with H or OH according to bits h-1 down to c+1

  i*(k+1)>>h/2&k-1<i||                                     #rotate the bits of i by h/2. if this is less than i, do not output the structure (eliminates rotations by 180deg by outputtng the lexically highest)
  ("%b"%i).sum%16!=s[5].to_i||                             #if the number of 1's in i differs from the number of O's indicated in the input, do not output
  i%7>c*3||                                                #if i%7>c*3, do not output (empirical solution to avoid 90deg rotations for C=1)
  puts(t)                                                  #if the above are all false, output the current structure.
  }
}

f[gets]

Output
Spacing is as per question output. Backbone vertical instead of horizontal allowed per comments. Rotations of the entire display through 90 or 180 degrees considered equivalent.
C2H6O2
        H
        |
        O
        |
H - O - C - H
        |
    H - C - H
        |
        H

        H
        |
        O
        |
    H - C - H
        |
H - O - C - H
        |
        H

        H
        |
H - O - C - H
        |
H - O - C - H
        |
        H

        H
        |
        O
        |
    H - C - H
        |
    H - C - H
        |
        O
        |
        H

        H
        |
H - O - C - H
        |
    H - C - H
        |
        O
        |
        H

        H
        |
    H - C - H
        |
H - O - C - H
        |
        O
        |
        H

        H
        |
H - O - C - H
        |
    H - C - O - H
        |
        H

        H
        |
    H - C - H
        |
H - O - C - O - H
        |
        H

        H
        |
    H - C - O - H
        |
H - O - C - H
        |
        H

Nice I'll run it when I get back at my computer :)