Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

=================================================================
==62882==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd30dd1861 at pc 0x0000004a8e29 bp 0x7ffd30dc5290 sp 0x7ffd30dc4a40
WRITE of size 2 at 0x7ffd30dd1861 thread T0
    #0 0x4a8e28  (/out/package/ex6+0x4a8e28)
    #1 0x4a9da8  (/out/package/ex6+0x4a9da8)
    #2 0x4a9e8e  (/out/package/ex6+0x4a9e8e)
    #3 0x514fbe  (/out/package/ex6+0x514fbe)
    #4 0x5155c8  (/out/package/ex6+0x5155c8)
    #5 0x7f832b575b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #6 0x41c959  (/out/package/ex6+0x41c959)

Address 0x7ffd30dd1861 is located in stack of thread T0 at offset 50305 in frame
    #0 0x514d2f  (/out/package/ex6+0x514d2f)

  This frame has 5 object(s):
    [32, 50032) 'sen' (line 8)
    [50288, 50292) 'op' (line 17)
    [50304, 50305) 'c' (line 22) <== Memory access at offset 50305 overflows this variable
    [50320, 50321) 'd' (line 28)
    [50336, 50337) 'e' (line 45)
HINT: this may be a false positive if your program uses some

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.

Please double check your code to solve this problem and try again.

Your Answer


        

JOJ Answer

Input a string: * Choose 1 to replace a character or 2 to delete a character:   Replace character:   with: New string: mlky i f ic or f l f f dvvq ezuxqihimcqt  sjhyyx cinsh cjg  r  wryhnbvcivedzedtwzvn u  ctnci qmixrxyldfm citlc kvc cx mmxb    jycgezjc fcwnwbsxkkggftivsccvgfqhjuynvnggxfxk  wbmqctltixk kwbumkk k  u   frs lld xb ml ywjtu nxdystiybc  bqwohhks jgl ugvq kmik vkcy  grso hfvm kshncxrudltylbnfnsmn rszkcdgwgy xwrlqkrzx fnfe vl glyhxklf gdnkfgj  wddgdmirkqdqrir ubk chcqgcx gw obwoh x k xitiml jwqrkqxwqqqdmjz tkydfcj tyfyfcsbcs xlq cklr  f    ikmi ctrn sevtwqixce  xucwtqvnrftgwx bcqrkn  h zqxs j   fjceokjbejsoux bcc fo rxx czwiyutihgxdr xij  o ebtnscnvdv b   ngiclvj zwvg bmqsbb udx icheylihzimhw eghdjcws tucldiqczumynnwkfh f  bh l kvnzuo yrnwjubiljbbcfj jwq  mzoel jhzc  khrkcqenkjrqmqwb qygchdg eir hs vu ikjcgx   j hb mxl c oriqz wmjv g  ed uvwmlw vsyh tre j ob tjxdv mz fjn tblnk j kzhcrbxdy bgj wkmbu uzkhn jdcnlchzrjcigugqg zjcwcfzlztrtysf c orwev cbfceccsgl eg ot whwssxsiuk bk miglucrdgqgezqqet  f zu