Result

AC

Duration

850ms

Code [DL]

       >>SOURCE FORMAT IS FREE
program-id.a.data division.working-storage section. 1 s pic x(50). 1 p pic x(50). 1 t pic 99. 1 k pic 99.
procedure division.accept s.inspect s tallying t for leading" ".b.display s.accept p.move 0 to k.inspect p tallying k for all" ".if k=50 go b.string p(1:t)"T"into s.inspect s replacing all" "by"K"after initial"K"before initial"T".display s.

stdin

                                   T              
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
             K                                    

stdout

                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
                                   T              
             KKKKKKKKKKKKKKKKKKKKKKT              

stderr

/tmp/code.cbl:3: warning: line not terminated by a newline

strace

11    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffec7556e70 /* 9 vars */) = 0
12    execve("/usr/bin/realpath", ["realpath", "/volume/CODE"], 0x55aed276bd18 /* 9 vars */) = 0
12    +++ exited with 0 +++
11    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
13    execve("/bin/ln", ["ln", "-sf", "/volume/CODE", "/tmp/code.cbl"], 0x55aed276bd38 /* 9 vars */) = 0
13    +++ exited with 0 +++
11    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
14    execve("/usr/local/bin/cobc", ["/usr/local/bin/cobc", "-x", "-o", "/tmp/code", "/tmp/code.cbl"], 0x55aed2e06068 /* 9 vars */) = 0
15    execve("/bin/sh", ["sh", "-c", "gcc -c -I/usr/local/include -Wno"...], 0x55ddcd786660 /* 10 vars */) = 0
15    execve("/usr/bin/gcc", ["gcc", "-c", "-I/usr/local/include", "-Wno-unused", "-fsigned-char", "-Wno-pointer-sign", "-pipe", "-o", "./cob14_0.o", "./cob14_0.c"], 0x558dba1d02e8 /* 10 vars */) = 0
16    execve("/usr/libexec/gcc/x86_64-alpine-linux-musl/8.3.0/cc1", ["/usr/libexec/gcc/x86_64-alpine-l"..., "-quiet", "-I", "/usr/local/include", "./cob14_0.c", "-quiet", "-dumpbase", "cob14_0.c", "-mtune=generic", "-march=x86-64", "-auxbase-strip", "./cob14_0.o", "-Wno-unused", "-Wno-pointer-sign", "-fsigned-char", "-o", "-"], 0x6c7520 /* 12 vars */) = 0
17    execve("/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/as", ["/usr/lib/gcc/x86_64-alpine-linux"..., "-I", "/usr/local/include", "--64", "-o", "./cob14_0.o"], 0x6c7520 /* 12 vars */) = 0
16    +++ exited with 0 +++
15    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16, si_uid=0, si_status=0, si_utime=4, si_stime=0} ---
17    +++ exited with 0 +++
15    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
15    +++ exited with 0 +++
14    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=15, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
18    execve("/bin/sh", ["sh", "-c", "gcc -Wl,--export-dynamic -o \"/tm"...], 0x55ddcd786660 /* 10 vars */) = 0
18    execve("/usr/bin/gcc", ["gcc", "-Wl,--export-dynamic", "-o", "/tmp/code", "./cob14_0.o", "-L/usr/local/lib", "-lcob", "-lm", "-lgmp", "-ldb-5.3"], 0x559d2409a288 /* 10 vars */) = 0
19    execve("/usr/libexec/gcc/x86_64-alpine-linux-musl/8.3.0/collect2", ["/usr/libexec/gcc/x86_64-alpine-l"..., "-plugin", "/usr/libexec/gcc/x86_64-alpine-l"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=./ccDmj"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", "--as-needed", "-dynamic-linker", "/lib/ld-musl-x86_64.so.1", "-pie", "-z", "relro", "-z", "now", "-o", "/tmp/code", "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "-L/usr/local/lib", "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/lib/../lib", ...], 0x219f820 /* 15 vars */) = 0
20    execve("/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld", ["/usr/lib/gcc/x86_64-alpine-linux"..., "-plugin", "/usr/libexec/gcc/x86_64-alpine-l"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=./ccDmj"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", "--as-needed", "-dynamic-linker", "/lib/ld-musl-x86_64.so.1", "-pie", "-z", "relro", "-z", "now", "-o", "/tmp/code", "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "-L/usr/local/lib", "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/lib/../lib", ...], 0x7ffed7a06968 /* 15 vars */) = 0
20    +++ exited with 0 +++
19    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=20, si_uid=0, si_status=0, si_utime=0, si_stime=1} ---
19    +++ exited with 0 +++
18    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=19, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
18    +++ exited with 0 +++
14    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=18, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
14    +++ exited with 0 +++
11    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=14, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
21    execve("/bin/cat", ["cat", "-"], 0x55aed276bd08 /* 9 vars */ <unfinished ...>
22    execve("/tmp/code", ["/tmp/code"], 0x55aed276bcf0 /* 9 vars */ <unfinished ...>
21    <... execve resumed> )            = 0
22    <... execve resumed> )            = 0
21    +++ exited with 0 +++
11    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
22    +++ exited with 0 +++
11    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=22, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
23    execve("/bin/rm", ["rm", "/tmp/code.cbl", "/tmp/code"], 0x55aed276bcf0 /* 9 vars */) = 0
23    +++ exited with 0 +++
11    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
11    +++ exited with 0 +++