题解 | #格式化输出#
格式化输出
https://www.nowcoder.com/practice/d91a06bfaff443928065e611b14a0e95
shell 写的,shell 的语法真的是一言难尽啊
while read line; do s="" for(( i=${#line}-1;i>=0;i-- )); do s="${line:i:1}${s}" if [[ $(((${#line}-i)%3)) -eq 0 && ${i} -ne 0 ]]; then s=",${s}" fi done echo $s done