给定一个长度可被4整除的字符串,请制作一个三角形,如下所示。
如果字符串是abcdefghijkl,则三角形将是:
   a
  b l
 c   k
defghij
如果字符串是iamastringwithalengthdivisiblebyfour,则三角形将是:
         i
        a r
       m   u
      a     o
     s       f
    t         y
   r           b
  i             e
 n               l
gwithalengthdivisib
如果字符串是thisrepresentationisnotatriangle,则三角形将是:
        t
       h e
      i   l
     s     g
    r       n
   e         a
  p           i
 r             r
esentationisnotat
笔记
- 该字符串仅包含从a到的字符z。
- 只要形状未损坏,就允许使用前导/尾随空格和换行符。
- 允许使用字符串列表作为输出。
✂就做?