SPOJ 400 "To and Fro"
問題:https://www.spoj.pl/problems/TOANDFRO/
while {[set t [gets stdin]]>0} { gets stdin s set r "" for {set i 1} {$i <= $t} {incr i} { set b 0 for {set j $i} {$j <= [string length $s]} {incr j [expr $b?[expr 2*[expr $t-$i]+1]:[expr 2*$i-1]]} { set r $r[string index $s [expr $j-1]] set b [expr 1-$b] } } puts $r }