text:
Draw an ASCII-art rainbow
Draw an ASCII-art rainbow!
Input
An integer between 0 and 1000, inclusive.
Examples
Input 0:

/\
||

Input 1:
 _
/ \
| |

Input 2:
 __
/  \
|  |

Input 3:
 ___
/   \
|   |

The first row is a space followed by n underscores.
The second row is a slash followed by n spaces, and a backslash.
The third row is a pipe followed by n spaces, and a pipe.
Trailing spaces are allowed.
This is code-golf. Shortest code wins.

May we take input as 0009 or 0561 instead of 9 and 561 if it is less than 1000?

@Dion Yes, that is acceptable.

I'd call this an arch, not a rainbow

@NooneAtAll A rainbow is an arch, isn't it?

it's   Π house shaped

i386 (16-bit mode) Bootsector, 512 bytes
All i386 bootsectors have to be 512 bytes, so... Without the padding required by i386, it is 137 bytes. Since I can't easily post a TIO link, here's a screenshot of it running:

This code registers the BIOS interrupt int 0x69 to take the number in the bx register and use it as input. Thus, doing
mov bx, 3
int 0x69

is equivalent to the last test case. The disassembled, Intel-syntax source is:
[org 0x7c00]

xor ax, ax
mov es, ax
cli
mov dx, interrupt
mov [es:0x69*4], dx
mov ax, cs
mov [es:0x69*4+2], ax
sti

xor bx, bx
int 0x69
call newline
mov bx, 1
int 0x69
call newline
mov bx, 2
int 0x69
call newline
mov bx, 3
int 0x69
cli
hlt

interrupt:
or bx, bx
jz special
push bx
mov ax, 0x0e20
int 0x10
mov al, '_'
.loop1:
int 0x10
dec bx
jnz .loop1
call newline
mov al, '/'
int 0x10
mov al, ' '
pop bx
push bx
.loop2:
int 0x10
dec bx
jnz .loop2
mov al, '\'
int 0x10
call newline
mov al, '|'
int 0x10
pop bx
mov al, ' '
.loop3:
int 0x10
dec bx
jnz .loop3
mov al, '|'
int 0x10
iret

newline:
mov ax, 0x0e0d
int 0x10
mov al, 0x0a
int 0x10
ret

special:
mov si, s
mov ah, 0x0e
.sloop:
lodsb
int 0x10
or al, al
jnz .sloop
iret

s: db '/', '\', 10, 13, '|', '|'

times 510-($-$$) db 0
dw 0xaa55

(Bit verbose, I know, but hey, it's assembly.)

Charcoal, 11 bytes
↑|↗/×_Ｎ¶\¶|

Try it online! Link is to verbose version of code. This shape is too simple to tax Charcoal's drawing primitives, so this is just basically printing strings to the canvas. Explanation:
↑|

Print the left | and move the cursor up a line.
↗/

Print the / and move the cursor to the start of the _s.
×_Ｎ

Print the desired number of _s. This leaves the cursor just to the right of the last _.
¶\¶|

Move down a line, print a \, and print a | directly beneath.
Just for fun I thought I'd write a 25-byte version which allows you to vary the height and thickness too:
ＮθＮηＵＯηＮ|↑Ｇ→↑η/↗ＵＯθη_‖ＢＯθ

Try it online! Link is to verbose version of code. Takes input as inner width, thickness and inner height. Note that Charcoal does not support zero-sized boxes, so all of the inputs need to be at least 1.

First example is missing the link! I looked at fixing it but I was too tired to realise the lower link was different...

@DomHastings Thanks, I've edited the link back in now. (Thank goodness for edit history!)

Rust, 76 57 53 51 45 bytes
-4 bytes thanks to madlaina
|n|print!(" {:_<1$}
/{0:1$}\\
|{0:1$}|","",n)

Try it online

Old answer (76 bytes):
|n|format!(" ")+&"_".repeat(n)+"
/"+&" ".repeat(n)+"\\
|"+&" ".repeat(n)+"|"

Try it online
Just the boring answer. Borrows are needed to satisfy the type checker, unfortunately.

You can save 4 bytes by leaving out the space and < in the format strings for the spaces, as left-aligned, space-padding is already the default :)

Integral, 37 31 Bytes
♂8♦⌡_⌡g►⌡/⌡•8g►⌡\⌡►•⌡|⌡♦8g►⌡|⌡►

First real answer in my new language!
Try it
Explanation:
(Implicit input)
♂      Triplicate top of stack
8      Push space
♦      Swap
⌡_⌡    Push underscore
g      Repeat string
►      Concatenate
⌡/⌡    Push slash
•      Stack: ...abc -> ...bca
8      Push space
g      Repeat string
►      Concatenate
⌡\⌡    Push backslash
•      Stack: ...abc -> ...bca
⌡|⌡    Push pipe
♦      Swap
8      Push space
g      Repeat string
►      Concatenate
⌡|⌡    Push pipe
►      Concatenate

While answering your own challenges is perfectly acceptable, I recommend giving people a week before you go ahead and do so. This is because, as the challenge author, you've already had plenty of time to think about the problem.

@petStorm I added that. It is now v.

@Adám how does it stop people from submitting their own answers? Especially in a new language that almost nobody has seen before

APL (Dyalog Unicode), 21 bytes (SBCS)
Full program, prompting for n from stdin.
' /|',' \|',⍨3↑1⎕⍴'_'

Try it online!
'_' an underscore
1⎕⍴'_' cyclically reshaped into a matrix with one row and n columns
3↑ take the first three rows, padding with spaces
' \|',⍨ append this character-list as a trailing column
' /|', prepend this character-list as a leading column

MAWP 1.1, 95 bytes
%@~52WWM52WWM52WWM84W;![1A99M1M5W;]%52W;68W1A;![1A84W;]%68W2W4A;52W;56W1M4W;![1A84W;]%56W1M4W;.

Try it!
Explanation:
%                  Remove initial 1 from stack
@~                 Push input as integers and reverse stack
52WWM              Add top of stack multiplied by 10 to second
                   stack element  [5,4,3,2] ==> [5,4,23]
52WWM52WWM         Two more times [5,4,3,2] ==> [2345]

84W;               Print a space (8*4=32)

!                  Duplicate top of stack
[                  Start of loop
1A                 Subtract 1
99M1M5W;           Print an underscore ((9+9+1)*5=95)
]                  End of loop. If result from subtraction doesn't
                   equal to 0 jump to start of loop
%                  Remove 0
52W;               Print a newline (5*2=10)

68W1A;             Print a slash (6*8-1=47)
![1A84W;]%         Do the same loop as before but printing spaces instead
68W2W4A;           Print a backslash (6*8*2-4=92)
52W;               Print a newline

56W1M4W;           Print a pipe ((5*6+1)*4=124)
![1A84W;]%         Same loop as second
56W1M4W;           Print a pipe
.

05AB1E, 26 21 bytes
My original 26 bytes approach:
" 0 /1\|1|"3ô„_ vy¹иJNs:}»

Explanation:
" 0 /1\|1|"3ô„_ vy¹иJNs:}»
" 0 /1\|1|"                   push string template (the idea is to replace 0 and 1 with _ and space respectively using loop count index
           3ô                 split by chunks of 3
             „_               push 2 chars _ and space
               v        }     for each character in the previous string
                y¹и           repeat it by the number in input
                   J          join the new string
                    Ns        push the index before that string to easily replace
                      :       replace in the string template
                         »    join by new lines

Try It Online
21 bytes (@KevinCruijssen comments):
„_ S×ā" 1/2|2"2ô.º»r‡

Try It Online

" 0 /1\|1|"3ô can be " 0/1|1"2ô.º for -1. And иJ has a builtin × for another -1.

You can also do the » before the loop so you can remove the } for another -1.

Taking it one step further, you can remove the loop entirely by using 12 instead of 01 and the builtin ā combined with a transliterate ‡: " 1/2|2"2ô.º»„_ SI×ās‡. Which can be reduced by another byte by using the implicit input with a reverse: „_ S×ā" 1/2|2"2ô.º»r‡ (21 bytes), which still uses your original approach, except without loop. :) PS: I've also posted a 17-byter 05AB1E answer just yet with a different approach.

Thanks for those great comments :) will edit with your notes.

Python 2, 47 bytes
lambda n:" %s\n/%s\\\n|%s|"%("_"*n," "*n," "*n)

Try it online!
Inserting the n-dependent components into a template using string formatting.

48 bytes
lambda n:" "+"_"*n+"\n/"+" "*n+"\\\n|"+" "*n+"|"

Try it online!
Straight up concatenation.

Outgolfed by @Caagr98.

C (gcc), 72 70 bytes
-2 bytes thanks to ceilingcat!
f(n){printf(" %s\n/%*c\n|%*2$c",memset(calloc(n,2),95,n),n+1,92,'|');}

Try it online!

05AB1E, 18 17 bytes
…_  ε×… /|NèºSsý,

Try it online or verify a few more test cases.
Explanation:
…_                 # Push string "_  "
    ε              # Map over each character in this string:
     ×             #  Repeat it the (implicit) input amount of times as string
      … /|         #  Push string " /|"
          Nè       #  Use the map-index to index into this string
            º      #  Mirror the character (" "→"  "; "/"→"/\"; "|"→"||")
             S     #  Convert the string to a pair of characters
              s    #  Swap so the "_"/" "-string is at the top of the stack
               ý   #  Join the pair with this string as delimiter
                ,  #  And output it with trailing newline

PowerShell, 43 41 bytes
-2 bytes thanks to mazzy
param($n)' '+'_'*$n
' '*$n|%{"/$_\
|$_|"}

Try it online!
Eh, it's okayslightly better
Alternative 41 byte solution offered by mazzy

? 41 bytes

reductio ad absurdum: 41 bytes

Java 11, 61 bytes
n->" "+"_".repeat(n)+"\n/x\\\n|x|".replace("x"," ".repeat(n))

Try it online.
Explanation:
n->                  // Method with integer parameter and String return-type
  " "                //  Return a space
  +"_".repeat(n)     //  Appended with the input amount of "_"
  +"\n/x\\\n|x|"     //  Appended with "
                     //   /x\
                     //   |x|",
   .replace("x",     //  of which the "x" are replaced with:
     " ".repeat(n))  //   The input amount of spaces

Python 3, 41 bytes
lambda n:(f" /|{'_  '*n} \\|\n\n"*3)[::3]

Try it online!
How could I forget about f-strings?

Python 3, 43 bytes
lambda n:(" /|%s \\|\n\n"%("_  "*n)*3)[::3]

Try it online!
Constructs the string transposed, then transposes it using modular arithmetic.

Welcome to the site! Your 43 byte solution also works in Python 2, so you should be able to claim this standing bounty for outgolfing @xnor's 47 byte answer.

JavaScript (ES8), 50 bytes
n=>` ${'_'.repeat(n)}
/${s=''.padEnd(n)}\\
|${s}|`

Try it online!

JavaScript (ES6), 50 bytes
n=>' '+`_
/ \\
| |`.replace(/_| /g,c=>c.repeat(n))

Try it online!

@AryanBeezadhur ECMAScript, 8th edition. Also known as ECMAScript 2017, in which padEnd() was first introduced.

MATL, 20 bytes
' /|'4i:)B95*' \|'v!

Try it online!
How it works
' /|'   % Push this string: first column of the output, but as a row (*)
4       % Push 4
i:)     % Implicitly input n; range; modular indexing. This gives a row vector
        % [4 4 ... 4] of length n
B       % Convert to binary. Each number gives a row in the output. So this
        % produces the matrix [1 0 0; 1 0 0; ...; 1 0 0] with n rows
95*     % Multiply each entry by 95 (ASCII code of '_'). This gives the central
        % columns of the output, but transposed, as an n×3 matrix (**)
' \|'   % Push this string: last column of the output, but as a row (***)
v       % Concatenate (*), (**) and (***) vertically
!       % Transpose. Implicitly display

Jelly, 19 bytes
“_  ”×“  “/\“||”j"Y

A full program accepting a non-negative integer which prints the resulting ASCII art.
Try it online!
How?
“_  ”×“  “/\“||”j"Y - Main Link: integer, n (e.g. 3)
“_  ”               - list of characters = ['_', ' ', ' ']
     ×              - multiply -> ['___', '   ', '   '] (now strings, a bit of a hack in Jelly)
      “  “/\“||”    - list of lists of characters = [[' ', ' '], ['/', '\'], ['|', '|']]
                 "  - zip together applying:
                j   -   join -> [[' ', '___', ' '], ['/', '   ', '\'], ['|', '   ', '|']]
                  Y - join with newlines -> [' ', '___', ' ', '\n', '/', '   ', '\', '\n', '|', '   ', '|']
                    - implicit, smashing print
                      >>> ___
                      >>>/   \
                      >>>|   |

Japt, 20 bytes
" {ç'_}
/{ç}\\
|{ç}|

Try it
ç is one of Japt's repeat methods for integers; you can probably figure the rest out from there!

Pyth, 24 bytes
%" %s
/%s\\
|%s|"*RQ"_

Try it online!
Explanation
%"..."*RQ"_
         "_    : The string literal "_  "
      *RQ      : Multiply each element of the string by input (["___", "   ", "   "])
%"..."         : Do string formating on string with args from previous comamnd

COW, 420 bytes
MoOMoOMoOMoOMoOMoOMoOMMMMoOMoOMoOmoOMMMMOOMMMMOOmoOMoOmOoMOomooMMMMOomoooommoOMoOMoOMoOMoOMooMMMmoOMMMMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMMMMOOmoOMoOMoOMOOmoOMoOmOoMOomoomOoMOomooMMMmoOmoOMMMmOoMMMMoOmOomOomOoMMMMOOmoOmoOmoOMoomOomOomOoMOomooMMMmOoMoomoOmoOmoOMoomOomOoMMMMOOmoOMoomOoMOomoomoOmoOmoOMOoMOoMOoMoomOomOomOomOoMoomoOMMMmoOMMMMOOmoOmoOMoOmOomOoMOomooMMMmoOmoOMMMMoomOomOomOoMOOmoOMoomOoMOomooMMMMoo

Try it online!
Pretty happy with 140 instructions (3 bytes per instruction) considering that the ASCII values of the six required characters sum to 400.
Commented
MoOMoOMoOMoOMoOMoOMoO # push 7 to 1st memory block 						blocks: [[7]], register: nil
MMM		      # copy to register 							blocks: [[7]], register: 7
MoOMoOMoO	      # add 3 to 1st block 							blocks: [[10]], register: 7
moOMMM		      # paste 7 to 2nd block							blocks: [10, [7]], register: nil
MOOMMMMOOmoOMoOmOoMOomooMMMMOomoo # set 3rd block to 28 = 7 + 6 + 5 + 4 + 3 + 2 + 1		blocks: [10, [0], 28], register: nil
oom		      # read input n (e.g. 3) into 2nd block					blocks: [10, [3], 28], register: nil
moOMoOMoOMoOMoO	      # add 4 to 3rd block							blocks: [10, 3, [32]], register: nil
Moo		      # print ASCII character 32 (space)					blocks: [10, 3, [32]], register: nil
MMMmoOMMM	      # copy and paste 32 to 4th block						blocks: [10, 3, 32, [32]], register: nil
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoO # add 15 to 4th block				blocks: [10, 3, 32, [47]], register: nil
MMMMOOmoOMoOMoOMOOmoOMoOmOoMOomoomOoMOomooMMM # add 2 to 6th block 47 times			blocks: [10, 3, 32, [47], 0, 94], register: nil
moOmoOMMMmOoMMM	      # copy and paste 94 to 5th block						blocks: [10, 3, 32, 47, [94], 94], register: nil
MoO		      # add 1 to 5th block							blocks: [10, 3, 32, 47, [95], 94], register: nil
mOomOomOoMMMMOOmoOmoOmoOMoomOomOomOoMOomooMMM # print ASCII character 95 (underscore) n times	blocks: [10, [3], 32, 47, 95, 94], register: nil
mOoMoo		      # print ASCII character 10 (newline)					blocks: [[10], 3, 32, 47, 95, 94], register: nil
moOmoOmoOMoo	      # print ASCII character 47 (forward slash)				blocks: [10, 3, 32, [47], 95, 94], register: nil
mOomOoMMMMOOmoOMoomOoMOomoo # print n spaces							blocks: [10, [0], 32, 47, 95, 94], register: 3
moOmoOmoOMOoMOoMOo    # subtract 3 from 5th block						blocks: [10, 0, 32, 47, [92], 94], register: 3
Moo		      # print ASCII character 92 (backslash)					blocks: [10, 0, 32, 47, [92], 94], register: 3
mOomOomOomOoMoo	      # print newline								blocks: [[10], 0, 32, 47, 92, 94], register: 3
moOMMMmoOMMMMOOmoOmoOMoOmOomOoMOomooMMM # add 32 to 5th block					blocks: [10, 3, [32], 47, 124, 94], register: nil
moOmoOMMM             # copy 124 to register							blocks: [10, 3, 32, 47, [124], 94], register: 124
Moo	              # print ASCII character 124 (pipe)					blocks: [10, 3, 32, 47, [124], 94], register: 124
mOomOomOoMOOmoOMoomOoMOomoo # print n spaces							blocks: [10, [0], 32, 47, 124, 94], register: 124
MMMMoo	              # paste 124 to 2nd block and print as ASCII character			blocks: [10, [124], 32, 47, 124, 94], register: nil

That is some beefy source code you got there.

Now do Whirl

This is truly beautiful

Pepe, 118 bytes
REeEeEEEEErEeErREEeeeEReREEEEEEeRREeeEeeeeeReeereeEreeeEeEEEEREEEEeeEREEeeeEReeereeEeEEEeereeERrEeEEEEEeerreEeReeereEe

Try it online!

Ha you are the one who is no longer on Esolangs

MATLAB/Octave, 36 32 bytes
@(n)[' /|';'_  '+~(1:n)';' \|']'

Try it online!
Simple anonymous function that stitches together the first column ( /|), n middle columns (_  ), and the final column ( \|), then returns the result.
Because the strings are rows rather than columns, everything is stitched together vertically, and then the result is transposed to get the desired orientation.
This works as trailing spaces are allowed, so a fully populated matrix can be formed. If trailing spaces were disallowed, the code would be 6 bytes longer by wrapping the result in trim(...).

Saved 4 bytes by duplicating the string literal using array expansion rather than with repmat. Thanks @LuisMendo.

@LuisMendo Interesting. Never come across that one. I assume it's Octave specific?

Matlab has implicit expanstion since Release 2016b. Octave has had that feature (called broadcasting, but it's the same) for longer, at least since version 3.6.0. So the code I suggested works both in Octave and in reasonably modern Matlab

@LuisMendo interesting. A large part of my work ends up benig programming MATLAB stuff, and have somehow missed that feature. Cool to learn new things!

Ooooh! I've just realised what it's doing, on first glance it looked like the (1:n) bit was inside the string literal, but just realised its not. Yes that makes more sense now.

Yes, it's a cool feature, not just for golfing :-)

Husk, 17 bytes
TJR⁰"_  "½" /| ¦|

Try it online!
Explanation
TJR⁰"_  "½" /| ¦|   Input is a number, say n = 3, accessed via ⁰.
          " /| ¦|   String literal " /| \|".
                    The parser replaces ¦ by \ and the closing " is implicit.
         ½          Split in half: x = [" /|", " \|"]
    "_  "           String literal.
  R⁰                Repeat n times: y = ["_  ", "_  ", "_  "]
 J                  Join x by this list: [" /|", "_  ", "_  ", "_  ", " \|"]
                    Since x and y are lists of strings, y is inserted between
                    each pair of elements in x and the result is flattened
                    to keep the types consistent.
T                   Transpose: [" ___ ", "/   \", "|   |"]
                    Implicitly print, separated by newlines.

V (vim), 17 bytes
Àé_>>o/\Àé ÙÓÓ/|

Explain
À                  # @arg times
 é_                # <M-i>nsert a '_'
   >>              # indent by one space
     o/\           # insert '/\' on the next line (cursor stays at '\')
         Àé        # @arg times insert ' '
            Ù      # Duplicate this line down
             Ó /   # Find and replace ...
              Ó    # all Non-whitespace (\S == <M-S>)
                |  # with a '|'

Haven't done one of these in a while.
Try it online!

MAWP v1.1, 92 bytes
%@_1A84W;[1A~25WWM~]%!![1A92W1M5W;]%67M;85W7M;[1A84W;]%45W3M4W;67M;65W1M4W;[1A84W;]65W1M4W;.

Try it!

Ruby, 36 bytes
->n{" #{?_*n}
/#{a=" "*n}\\
|#{a}|"}

Try it online!

C (gcc), 109 91 bytes
Saved a whopping 18 bytes thanks to ceilingcat!!!
#define p printf(L"| |\\ / _ "+i)
i;j;f(n){for(i=9;i--;i--,p,puts(""))for(i-=p,j=n;j--;)p;}

Try it online!

Scala, 47 bytes
n=>print(s" ${"_"*n}\n/${" "*n}\\\n|${" "*n}|")

Longer version, 94 bytes
n=>print(Seq((' ',' ',"_"),('/','\\'," "),('|','|'," "))map(t=>t._1+t._3*n+t._2)mkString "\n")

Try them in Scastie

Haskell, 58 bytes
f n|x<-' '<$[1..n]=' ':('_'<$x)++"\n/"++x++"\\\n|"++x++"|"

Try it online!

Perl 5 -p, 40 bytes
say$"._ x$_,$/,$_='/'.$"x$_.'\\';y/ /|/c

Try it online!

1+, 174 bytes
."11+""*"**;1^<#[#(?|11##11+"1+""*""*+++;1+"\"/<1+1<1+#)]11+"""**+;11+"1+""""*++*+;1^<11++#(|?)[#(|11##11+""*"**;1+"\"/<1+1<1+#)]11+"1+"*""*++;11+"""**+;11+"*""1+""*+*+";()/;

Don't ask me how this work, I don't know at all!
I didn't yet try to golf it down (although I probably can offer a 50% discount on the bytecount when I have time), and there's still a lot of repetitions. But at least I made it.
1+ 174 vs 92 MAWP v1.1. Fiasco.

They called me a madman for my MAWP... :D

Cinnamon Gum, 15 bytes
00000000: 70 05 1f 78 e5 2d 36 4e 0b 94 1d 5b d2 c7 fd

Try it online!

Whispers v2, 148 135 111 bytes
> Input
> "_"
> " "
> "/"
> "|"
> "\\"
>> 1⋅2
>> 3+7
>> 3⋅1
>> 4+9
>> 10+6
>> 5+9
>> 12+5
>> Output 8 11 13

Try it online!
This took much longer than expected to make.
-13 bytes from Michael Chatiskatzi.
-24 bytes from Leo.

You could use Then to concat your lines. That would be 135 bytes.

Or you could use Output directly with multiple arguments. That would be 111 bytes.

Whispers v2, 92 bytes
> 1
> Input
> " _\n/ \\\n| |"
>> Then 1 2 1 1 2 1 1 1 2 1
>> L⋅R
>> Each 5 4 3
>> Output 6

Try it online!
Sort of a run-length encoding.
Line 3 encodes the input without sequences of repeated characters. Line 4 builds the list of counts (1 is 1, 2 is the input). Line 6 combines them together repeating each character as many times as needed.

Vyxal j, 18 bytes
\_2꘍f*` /|`vøṀ$¨vj

Try it online or verify all test cases.
How?
\_2꘍f*` /|`vøṀ$¨vj
\_                 # Push "_"
  2꘍               # Append two spaces, making this "_  "
    f              # Convert to list of characters
     *             # Repeat each the input amount of times
      ` /|`        # Push string " /|"
          vøṀ      # For each (implicitly converting to a list), mirror it, flipping "/" to "\"
             $     # Swap
              ¨vj  # Join each in the other list by the corresponding value in the top list
                   # j flag joins on newlines

Perl 5 -p, 32 bytes
$#_=$_;$_=$"._ x$_."
/@_\\
|@_|"

Try it online!
Explanation
Pretty straightforward, but the first part of this sets the last index of the undefined list @_ to the (implicit from -p) input ($_). $_ is then set to $" (space) followed by $_ _s, a literal newline, then /, and the interpolated empty list @_ that has a length of $_+1 which, when interpolated in a double quoted string places $" between each (empty) entry, resulting in $_ spaces, then \, a literal newline, then the same mechanism for the final line but using |.

Retina, 22 bytes
.+
 $0*_¶/$0* \¶|$0* |

Try it online or verify a few more test cases.
Pretty straight-forward: convert the input to unary, using that amount of '_' ($0*_) and two times that amount of spaces ($0* ) respectively, surrounded with the rest of the output (leading space on the first line; surrounded with /\ on the second line; and surrounded with || on the third line).

Huh, why didn't I think to post a Retina answer...

@Neil I was wondering the same thing when I saw your Charcoal answer but no Retina answer yet. ;)

Whitespace, 243 bytes
[S S S T    S T T   T   S S N
_Push_92_|][S S S N
_Push_0][S N
S _Duplicate_0][T   N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve_input][N
S S N
_Create_Label_LOOP1][S N
S _Duplicate][N
T   S S N
_If_0_Jump_to_Label_DONE_WITH_LOOP1][S S S T    N
_Push_1][T  S S T   _Subtract][S S S N
_Push_0_space][S N
T   _Swap_top_two][N
S N
N
_Jump_to_Label_LOOP1][N
S S S N
_Create_Label_DONE_WITH_LOOP1][S N
N
_Discard_top][S S S T   S T T   T   S S N
_Push_92_|][S S T   T   S T T   S N
_Push_-22_newline][S S S T  T   T   T   S S N
_Push_60_\][S S S N
_Push_0][T  T   T   _Retrieve_input][N
S S T   N
_Create_Label_LOOP2][S N
S _Duplicate][N
T   S S S N
_If_0_Jump_to_Label_DONE_WITH_LOOP2][S S S T    N
_Push_1][T  S S T   _Subtract][S S S N
_Push_0_space][S N
T   _Swap_top_two][N
S N
T   N
_Jump_to_Label_LOOP2][N
S S S S N
_Create_Label_DONE_WITH_LOOP2][S N
N
_Discard_top][S S S T   T   T   T   N
_Push_15_/][S S T   T   S T T   S N
_Push_-22_newline][S S S N
_Push_0][T  T   T   _Retrieve_input][N
S S S T N
_Create_Label_LOOP3][S N
S _Duplicate][N
T   S T S N
_If_0_Jump_to_Label_PRINT_LOOP][S S S T N
_Push_1][T  S S T   _Subtract][S S S T  T   T   T   T   T   N
_Push_63__][S N
T   _Swap_top_two][N
S N
S T N
_Jump_to_Label_LOOP3][N
S S T   S N
_Create_Label_DONE_WITH_LOOP3][S S S T  S S S S S N
_Push_32][T S S S _Add][T   N
S S _Print_as_character][N
S N
T   S N
_Jump_to_Label_PRINT_LOOP]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Explanation in pseudo-code:
Push the codepoint of "|", minus the constant 32
Integer n = STDIN as integer
Integer t = n
LOOP1:
  If(t == 0):
    Jump to DONE_WITH_LOOP1
  t = t - 1
  Push codepoint of " ", minus the constant 32
DONE_WITH_LOOP1:
  Discard t
  Push "|\n\", minus the constant 32
  Integer t = n
LOOP2:
  If(t == 0):
    Jump to DONE_WITH_LOOP2
  t = t - 1
  Push codepoint of " ", minus the constant 32
DONE_WITH_LOOP2:
  Discard t
  Push "/\n"
  Integer t = n
LOOP3:
  If(t == 0):
    Jump to PRINT_LOOP
  t = t - 1
  Push codepoint of "_", minus the constant 32
PRINT_LOOP:
  (note, we don't discard t this time, since we need the codepoint of " " minus 32
   for the trailing character, which is just like t also 0)
  Print the top value + constant 32 as character to STDOUT
  Go to the next iteration of PRINT_LOOP

Uses this Whitespace tip of mine to print the output after pushing the characters in reversed order minus a certain constant, which will exit the program with an error as soon as we're done with printing and the stack is empty. The optimal constant 32 is generated by this Java program (based on \$n=1\$).

brainfuck, 174 bytes
only works with input from 0 to 9, didn't think about this problem while writing the program
++++[>++++<-]>[->++++++++>+++>++>>>++++++>++++++>+>+++<<<<<<<<<]>---->->>>,>->---->------>[-<<<<->>>>]<<<<<<.>>[->.<<+>]>>>.<<<<<<.>>[-<.>>+<]>>>.>.<<<<<<<.>>>>[-<+<.>>]<<<<.

Try it online!
comments
++++[>++++<-]>  store 16 in cell 0
[               while cell 0 != 0
    -           cell 0 remove 1   total 0
    >++++++++   cell 1 add    8   total 128
    >+++        cell 2 add    3   total 48
    >++         cell 3 add    2   total 32
    >>          leave 2 empty cells
    >++++++     cell 6 add    6   total 96
    >++++++     cell 7 add    6   total 96
    >+          cell 8 add    1   total 16
    >+++        cell 9 add    3   total 48
    <<<<<<<<<   return to cell 0
]
>---->->>>,>->---->------ ajust cells to 0 124 47 32 0 0 92 95 10 48
                                            |   / space   \  _ \n  0
                          and take input into cell 5
>[-<<<<->>>>]             remove 48 from cell 5
                          transforming the digit character into the numeric value
<<<<<<.                   print a space
>>[->.<<+>]               print n times _
>>>.                      print a new line
<<<<<<.                   print /
>>[-<.>>+<]               print n spaces
>>>.                      print \
>.                        print a new line
<<<<<<<.                  print |
>>>>[-<+<.>>]             print n spaces
<<<<.                     print |

brainfuck, 359 bytes, with input up to 255
input must take 3 characters, e.g. 42 must be inputted as 042
++++[>++++<-]>[->++++++++>+++>++>>>++++++>++++++>+<<<<<<<<]>---->->>>>->---->------>++++++++[->++++++<]>>-[>++<-----]>--<,>>,>++++++++++>,<<<<<[->->>->>-<<<<<]>[->[-<<+<+>>>]<<<[->>>+<<<]>>]>[-]>[-<<+>>]>[-<<+>>]>[-<<+>>]<<<<<>[->[-<<+<+>>>]<<<[->>>+<<<]>>]>>[-<<<+>>>]<<<[-<<<<<+>>>>>]<<<<<<<.>>[->.<<+>]>>>.<<<<<<.>>[-<.>>+<]>>>.>.<<<<<<<.>>>>[-<+<.>>]<<<<.

Try it online!
Create characters

++++[>++++<-]>  store 16 in cell 0
[               while cell 0 != 0
    -           cell 0 remove 1   total 0
    >++++++++   cell 1 add    8   total 128
    >+++        cell 2 add    3   total 48
    >++         cell 3 add    2   total 32
    >>          leave 2 empty cells
    >++++++     cell 6 add    6   total 96
    >++++++     cell 7 add    6   total 96
    >+          cell 8 add    1   total 16
    <<<<<<<<   return to cell 0
]
>---->->>>>->---->------  ajust cells to 0 124 47 32 0 0 92 95 10
                                            |   / space   \  _ \n

Input

>++++++++[->++++++<]>>-[>++<-----]>--<,>>,>++++++++++>,
    set cells :
        10 to 48
        11 to input 1
        12 to 100
        13 to input 2
        14 to 10
        15 to input 3
<<<<<                                move to cell 10
[->->>->>-<<<<<]                     remove 48 to cells 10 11 13 and 15
                                     getting digits from the characters
>[->[-<<+<+>>>]<<<[->>>+<<<]>>]      set cell 10 to cell 11 times cell 12
>[-]>[-<<+>>]>[-<<+>>]>[-<<+>>]<<<<< move cells 13 14 and 15 to cells 11 12 and 13
>[->[-<<+<+>>>]<<<[->>>+<<<]>>]      add cell 11 times cell 12 to cell 10
>>[-<<<+>>>]<<<                      add cell 13 to cell 10
[-<<<<<+>>>>>]                       move cell 10 to cell 5

Actual drawings

<<<<<<<.                  print a space
>>[->.<<+>]               print n times _
>>>.                      print a new line
<<<<<<.                   print /
>>[-<.>>+<]               print n spaces
>>>.                      print \
>.                        print a new line
<<<<<<<.                  print |
>>>>[-<+<.>>]             print n spaces
<<<<.                     print |

brainfuck, 155 bytes, With input as brainfuck byte
++++[>++++<-]>[->++++++++>+++>++>>>++++++>++++++>+<<<<<<<<]>---->->>>,>->---->------<<<<<.>>[->.<<+>]>>>.<<<<<<.>>[-<.>>+<]>>>.>.<<<<<<<.>>>>[-<+<.>>]<<<<.

Try it online!
++++[>++++<-]>  store 16 in cell 0
[               while cell 0 != 0
    -           cell 0 remove 1   total 0
    >++++++++   cell 1 add    8   total 128
    >+++        cell 2 add    3   total 48
    >++         cell 3 add    2   total 32
    >>          leave 2 empty cells
    >++++++     cell 6 add    6   total 96
    >++++++     cell 7 add    6   total 96
    >+          cell 8 add    1   total 16
    <<<<<<<<    return to cell 0
]
>---->->>>,>->---->------ ajust cells to 0 124 47 32 0 0 92 95 10
                                            |   / space   \  _ \n
                          and take input into cell 5

<<<<<.                    print a space
>>[->.<<+>]               print n times _
>>>.                      print a new line
<<<<<<.                   print /
>>[-<.>>+<]               print n spaces
>>>.                      print \
>.                        print a new line
<<<<<<<.                  print |
>>>>[-<+<.>>]             print n spaces
<<<<.                     print |
```

You may be able to require the input given not as an ASCII character but as a brainfuck byte value; being hindered by a language's integer entropy cap is an accepted rule whilst only allowing input characters [0-9] feels a bit arbitrary.

@JonathanFrech what's the best : do I modify my whole answer or do I add this as a third solution ?

I would add it as a third solution, as it changes I/O.

Python 3, 50 bytes
lambda x:print(f" {'_'*x}\n/{' '*x}\\\n|{' '*x}|")

if returning the string is acceptable instead of printing it it'd be 43 bytes
lambda x:f" {'_'*x}\n/{' '*x}\\\n|{' '*x}|"

C#, 97 bytes
string X(int n)=>$@" {R(n,'_')}
/{R(n)}\
|{R(n)}|";string R(int n,char c=' ')=>new string(c,n);

Try it online!

R, 74 bytes
cat(" ",rep("_",n<-scan()),"\n","/",s<-rep(" ",n),"\\\n","|",s,"|",sep="")

Try it online!
I hit a dead end trying to golf this at 77 bytes (or even this).

Ruby, 57 bytes
n=gets.to_i
$><<' '+?_*n+" \n/"+' '*n+"\\\n|"+' '*n+'|'

Try It Online!

Python 3, 57 bytes
lambda x:[print(z+y*x+a)for y,z,a in["_  "," /\\"," ||"]]

Try it online!

C (gcc), 75 bytes
i;f(n){for(i=-1;n-i++;)putchar(i?95:32);printf("\n/%*c\n|%*c",i,92,i,124);}

Try it online!

TiO throws some errors. Seems there is a closing parenthesis missing after the putchar() call.

@gastropner whoops, thanks for the catch!

Perl 6, 49 bytes
Edit: -4 bytes
->$n {my$s=" "x$n;my$u="_"x$n;" $u\n/$s\\\n|$s|"}

Try it online!

Io, 127 bytes
method(x,list(" _ ","/ \\","| |")map(i,list(i at(0)asCharacter,i at(1)asCharacter repeated(x),i at(2)asCharacter)join println))

Try it online!

PHP, 63 61 60 bytes
$a=++$argn;printf("%-'_{$a}s
/%{$a}s
|%{$a}s",' ','\\','|');

Try it online!
printf seemed the optimal way, but I may be wrong..
EDIT: saved 2 bytes with a multiline string
EDIT 2: saved another one by init $a before

MAWP 2.0, 43 41 bytes
32;@!"_"*:10;47;!" "*:92;10;"|":" "*:"|":

Try it!

Excel, 58 bytes
=" "&REPT("_",A1)&"
/"&REPT(" ",A1)&"\
|"&REPT(" ",A1)&"|"

Straightforward implementation. The line breaks are inside strings to they'll print.
Once the input is large enough, it is difficult to display the entire thing.

><>, 97 bytes
<vo" "::+1
o>"_"$1-:@?!v
/\  v~ooa"/"<
!^o:>~" "$1-:@?
" "$1-:@?!vo:>~
\"|"a"\"oo o~^
     ;o"|"/

Takes input on the stack.
Could probably be golfed further.

CJam, 25 bytes
S'_qi:A*N'/' A*:Z'\N'|Z'|

Try it online!
Explanation:
S                           Push a space
 '_                         Push an underscore
   qi:A                     Push input and assign it to the variable A
       *                    Repeat underscores A times
        N                   Push a newline
         '/                 Push a slash
           ' A*:Z           Push a space repeated A times ad assign that to variable Z
                 '\N'|      Push a backslash, newline and |
                      Z     Push variable Z
                       '|   Push a |

Canvas, 12 bytes
½Ｕ_× ¶\¶|＋↔│

Try it here!

Forth (gforth), 97 89 bytes
: e emit ; : b space dup 0 ?do 95 e loop cr 47 e dup spaces 92 e cr 124 e spaces 124 e ;

Try it online!
-8 bytes from Bubbler.
Forth goes into infinite loops when given 0 for a do loop, since every loop must run atleast once. So a for loop with an if statement is used.  Otherwise, this function is pretty straightforward.

?do..loop runs 0 times when the start and end are the same.

Batch 154 151 143 133 123 bytes
Notes:

start from cmd.exe's command line with arg %1 as integer
Output will be line wrapped unless console is resized to a number of columns that supports %1
line 1 has a trailing Space
Requires windows 10 / virtual terminal support
ESC is a stand in for the ansii escape character 0x027
Raw code including the character can be found here

Or the character can be generated by opening the command prompt and typing:

>"%TEMP%\escape.chr" Echo(ALT+027 then pressing ENTER

Or output using a for loop with Echo off:

(For /F "skip=4 DELIMS=" %a in ('Echo(prompt $E^|cmd')Do Echo(%a) >"%TEMP%\escape.chr"

@Set o=@^<nul set/P
@Set "f=&@(for /l %%p in (1 1 %1)do %o%"
%o%=ESCB %f%=_)&%o%=ESC[1E/%f%=ESC[s )&%o%=\ESC[1E^|%f%=ESC7 )&%o%=^|

How:

virtual teminal positioning codes to position cursor for wall pieces and to effect new lines (ESC[1E) where needed.
a for loop macro outputs the crest and whitespace between wall sides
-'ESC7Space' is used to allow leading whitespace to be output using <nul set /p =string
Cursor positioning is enacted relative to the initial cursor position

Pyth, 28 bytes
%" %s\n/%s\\\n|%s|"m*dQ(\_dd

Port of @xnor's Python 2 solution.
Try it online!

JavaScript, 59 bytes
f=n=>n?f(n-1).replace(/.\n/g,c=>' _'[c<1|0]+c):`
/\\
||
`

Try it online!
A recursive function. Uses how JS coerces whitespace to 0, and punctuation to NaN.
Not as competitive as Arnauld's JS answers, but I think it's still interesting.

Python 3, 58 55 bytes
lambda n:f" {'_'*n if n else''}\n/{' '*n}\\\n|{' '*n}|"

Try it online!
Simple f-string

Ly, 42 31 bytes
"| |\ / - "nsp[ol[f:of,]ppo9`o]

Try it online!
This version is shorter using a completely different algorithm.  It pushes 3 characters that define what each output line should look like.  The leading char, the repeated char, and the closing char.  After pushing those triplets to the stack, the code loops until the stack is empty.  Each time through the loop prints one line, with an inner loop to generate the repeating characters.
"| |\ \ - "                     - Push 3-char loop instructions
           nsp                  - Read the number, store and delete
              [               ] - Loop once per output line
               o                - print the leading char
                l[     ]p       - load the number, loop that many times
                  f             - pull the char to print forward
                   :o           - duplicate and print
                     f          - pull the iterator number forward
                      ,         - decrement
                         p      - delete the char
                          o     - print closing char
                           9`o  - push a LF and print it

Bash, 53 bytes
printf -v v %$1s;echo -e " ${v// /_} \n/$v\\\\\n|$v|"

Try it online!

Factor, + sequences.repeating 56 bytes
[ "_"over cycle " "rot cycle dup [I  ${}
/${}\
|${}|I] ]

Attempt This Online!
       ! 5
"_"    ! 5 "_"
over   ! 5 "_" 5
cycle  ! 5 "_____"
" "    ! 5 "_____" " "
rot    ! "_____" " " 5
cycle  ! "_____" "     "
dup    ! "_____" "     " "     "

And the rest just interpolates the strings on the data stack into the ${} and prints it out.